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.
- Host: GitHub
- URL: https://github.com/prodis/toy_robot
- Owner: prodis
- Created: 2016-06-16T02:45:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-16T02:49:46.000Z (about 10 years ago)
- Last Synced: 2025-02-02T18:44:54.537Z (over 1 year ago)
- Topics: prodis, ruby, simulation, toy-robot
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`