Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.55 KB

README.md

File metadata and controls

67 lines (54 loc) · 1.55 KB

HACS Problems

A collection of problems with solutions for everyone interested in HACS, but perhaps most useful to those taking the compilers class at NYU.

Installation

Make sure you have HACS installed, then clone the repository:

$ git clone https://github.com/evectant/hacs-problems.git

Usage

Use check problems to find the next unsolved problem in the recommended order:

$ ./check problems
Checking lists/IsEmpty.hx
  Failing tests
  ./check lists/IsEmpty.hx

Use check <problem> to see the failing tests:

$ ./check lists/IsEmpty.hx
Compiling lists/IsEmpty.hx
Running tests from lists/IsEmptyTest.csv
Test 1 failed
  ./lists/IsEmpty.run --scheme=IsEmpty --term=''
  Expect: True
  Actual: 
...
Passed 0/3 tests

Work on the problem until it passes the tests:

$ edit lists/IsEmpty.hx
$ ./check lists/IsEmpty.hx 
Compiling lists/IsEmpty.hx
Running tests from lists/IsEmptyTest.csv
Test 1 passed
  ./lists/IsEmpty.run --scheme=IsEmpty --term=''
  Expect: True
  Actual: True
...
Passed 3/3 tests

Compare with the reference solution:

$ view lists/IsEmptySolution.hx

Proceed to the next unsolved problem:

$ ./check problems
Checking lists/IsEmpty.hx
Checking lists/HeadTail.hx
  Failing tests
  ./check lists/HeadTail.hx

You can also use check list to list all the problems and work on them in any order.

See check help for more options.