An open API service indexing awesome lists of open source software.

https://github.com/prodis/toy_robot

A simulation of a toy robot moving on a square tabletop.
https://github.com/prodis/toy_robot

prodis ruby simulation toy-robot

Last synced: about 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

# Toy Robot Simulator
A simulation of a toy robot moving on a square tabletop.

For more details, see [Toy Robot Simulator Description](toy_robot.md).

## 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`