Giter Club home page Giter Club logo

toy-robot's Introduction

Codacy Badge Actions Status

Toy Robot

The application is a simulation of a Toy Robot moving on a square tabletop, of dimensions 5 units x 5 units. There are no other obstructions on the table surface. The Robot is free to roam around the surface of the table.

Inputs for the robot to move around are as follows:

      N
      |
      |
W <--------> E
      |
      |
      S

4 _________________
  |   |   |   |   |
  |   |   |   |   |
3 -----------------
  |   |   |   |   |
  |   |   |   |   |
2 -----------------
  |   |   |   |   |
  |   |   |   |   |
1 -----------------
  |   |   |   |   |
  |   |   |   |   |
0 -----------------
      1   2   3   4

PLACE X,Y,DIRECTION: Place the Robot at a given x,y facing given direction.
X - [0 - 4]
Y - [0 - 4]
DIRECTION - [NORTH EAST SOUTH WEST]

MOVE - Moves the Robot to the facing direction by one square

LEFT - Turn the Robot towards left

RIGHT - Turn the Robot towards right

REPORT - Prints the current position of the Robot

Run the simulator

Clone the repo. If you like to run the simulator using Docker, build the docker image.

docker image build -t toy-robot .

To run the app using docker, use following command,

docker container run --rm -it toy-robot

Then follow the instructions on the app.

To run the simulator without using docker,

# move into the folder
cd toy-robot

# run the robot
bin/toy_robot

Test

Run test using docker,

docker container run --rm toy-robot bash -c 'rspec spec/'

toy-robot's People

Contributors

iranthau avatar

Watchers

James Cloos avatar  avatar

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.