✨🤖 https://little-toy-robot.netlify.app/ 🤖✨
A TypeScript/React solution to the toy robot challenge.
Type the command into the input fiels and see the Robot execute it!
PLACE x y Facing
- places the robot on the board at the coordinates you setLEFT
- rotates the robot 90 degrees leftRIGHT
- rotates the robot 90 degrees rightMOVE
- move robot 1 tile towards where it's facing
The REPORT
of where the Robot is permanently available underneath the board.
OBSTACLE x y
- places an obstacle on the board. Up to 4 obstacles can be stacked in each cellROTOR START
- spins up the rotorROTOR STOP
- stops the rotorUP
- move up by one unit (max 4 units possible)DOWN
- move down by one unit
Limitations and other features
- Robot can not move off the board, or outside of the control range (4 units up) when airborn.
ROTOR START
command is needed for any airborne activities.- If Rotor is stopped when the robot is above an obstacle, the robot will fall down and crash and won't be able to take any more commands.
Back
button rewinds the robot to the previous state in history.
To run the app locally:
- clone this repo
- install node modules:
npm install
- start the app:
npm start
Unit tests are available with Jest.
To run them, run npm test
.
Made with 🤖 by Ana Lastoviria and Andy Sims.