Skip to content
Toy Robot Simulator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
node_modules
robot
test
LICENSE
PROBLEM.md
README.md
app.js
data.txt
data2.txt
empty.txt
package.json
test.csv

README.md

Toy Robot Simulator

Language: Node.js

Instructions to run simulator

  • Run npm install on root folder, it'll download dependencies required to run test cases
  • Run node app.js or npm start -- with argument file name

Instruction format

Please use only .txt. The simulator only accepts .txt files, with one command per line. The commands available are:

  • PLACE X,Y,F
  • MOVE
  • LEFT
  • RIGHT
  • REPORT

Example Input and Output

Example a

PLACE 0,0,NORTH
MOVE
REPORT

Expected output:

0,1,NORTH

Example b

PLACE 0,0,NORTH
LEFT
REPORT

Expected output:

0,0,WEST

Example c

PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT

Expected output

3,3,NORTH

Deliverables

Tests

  • Run npm test on the root folder to execute test cases
You can’t perform that action at this time.