Coder Social home page Coder Social logo

nodejs-toy-robot-simulator's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.