Skip to content

simmatrix/nodejs-toy-robot-simulator

Repository files navigation

NodeJS CLI Toy Robot Simulator

This is an old repo. Please refer to the new refactored Toy Robot Simulator - Updated 2020

Toy Robot Screenshot

This is a NodeJS command-line application. The Node version used to develop this is v10.11.0. You may refer to the full problem statement over here

Demo Video Link

Please view the demo video from this link

Constraint

Assuming that we would only have 5x5 units of "table" for the toy robot to roam about freely, without falling off.

Table for Toy Robot

Installation

  1. Install globally by running npm install -g
  2. Execute the command toy-robot

Running it from source

  1. Install dependencies by running yarn install
  2. Start the program by running yarn start

Different Cases Handled

  • When user go through the normal flow
  • When user keys in an invalid 1st command (that should be a PLACE command)
  • When user keys in an invalid coordinate
  • When user keys in an invalid direction
  • When user keys in an invalid commands (input other than PLACE, MOVE, LEFT, RIGHT, REPORT)
  • When the toy robot had moved to an invalid coordinate (changes will be discarded)

Test

You may check on the test by running yarn test

Toy Robot Test

About

A NodeJS command-line application of a toy robot simulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published