Skip to content

A simulation of a toy robot moving on a square tabletop.

Notifications You must be signed in to change notification settings

prodis/toy_robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy Robot Simulator

A simulation of a toy robot moving on a square tabletop.

For more details, see Toy Robot Simulator Description.

Dependencies

  • Ruby 2.3.1

Setup

git clone https://github.com/prodis/toy_robot.git
cd toy_robot
bundle install

Running

ruby main.rb [commands.txt]

Inside data directory there are some test case files.

Example:

$ ruby main.rb data/test_case3.txt
Output: 3,3,NORTH

Note that at the end of each input file in data directory is the expected result. I did it in order to a easy understanding.

Really this "invalid commands" at the end of the input files are ignored by the simulator.

Testing

bundle exec rspec

About

A simulation of a toy robot moving on a square tabletop.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages