- Clone this gist to your computer
git clone git+ssh://git@gist.github.com/1c23f58f33c0040853556dee4051d752.git rover-node
cd rover-node
- Move
rover_test.js
in to a folder namedtest
in the same directory asrover.js
to startmkdir test
mv rover_test.js test
- Install dependencies (
mocha
, for running tests)npm install
- Run the tests to verify that everything's set up correctly
mocha test/rover_test.js
We're going to build the API for a Mars rover using a test-driven approach. Some things that the rover could do:
* know which compass direction it is facing
* know where it is relative to its landing position
* move forward
* turn left and right
* follow a list of single-character commands (f,l,r)
* move backward (b)
* sense whether there is an obstacle
* refuse to move forward if the path is blocked
* anything else you think would be interesting