- Ensure you have a recent Ruby interpreter.
- If you do not already have it installed, please run
gem install bundler
From the project home:
./lib/exploring_mars.rb [input]
If input file name argument is not provided, input is read from stdin.
To run tests:
./test/test_suite.rb [input]
Open ./coverage/index.html
for coverage info.
If any of the lines contain syntax errors, the execution is aborted.
If plateau boundary is exceeded, the current probe is skipped, but program execution continues.
The problem seems to me similar to an interpreter of a subset of Logo programming language.
Features not explicitly demanded in the enunciate.
Implemented:
- Boundary checks (a probe cannot move outside the plateau)
- Syntax error handling
Not implemented:
- Collision detection
I decided not to do collision detection, which would necessarily involve reading the whole input before outputing anything, as it was not an explicit requirement and I believe there is enough material already for an initial assessment. I would be more than happy to implement the feature during the pair programming session, though.