GithubHelp home page GithubHelp logo

toyrobot's Introduction

Toy Robot Simulator

Rules

  • A toy robot is free to move on a board - default 5 units x 5 units.
  • There are no obstructions on the table surface.
  • Any command that would cause the robot to move off the table should be ignored.
  • Any command before a valid PLACE command should be ignored.

Commands

PLACE X,Y,F

Places the robot on the table, must accept valid placement (X,Y) and a facing direction (F).

Please notice X,Y must be interger numbers and PLACE must be using all capital letters

MOVE

Moves the robot forward one space at a time.

Please notice MOVE must be using all capital letters

LEFT

Rotates the robot 90° left.

Please notice LEFT must be using all capital letters

RIGHT

Rotates the robot 90° right.

Please notice RIGHT must be using all capital letters

REPORT

Displays the current placement and direction the robot is facing.

Please notice RIGHT must be using all capital letters

Installation

git clone https://github.com/Allen-Ning/ToyRobot
cd ToyRobot

docker-compose build toy_robot

Tests

Tests can be run with the:

cd ToyRobot

docker-compose run toy_robot rspec spec

Lint

Lint can be run with the:

cd ToyRobot

docker-compose run toy_robot rubocop

Simulator

The simulator can be run with:

cd ToyRobot

docker-compose run toy_robot bin/toy_robot.rb samples/ExampleA
docker-compose run toy_robot bin/toy_robot.rb samples/ExampleB
docker-compose run toy_robot bin/toy_robot.rb samples/ExampleC

toyrobot's People

Contributors

allen-ning avatar

Watchers

James Cloos avatar  avatar

toyrobot's Issues

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.