https://github.com/adamdilek/robot-simulation
The Toy Robot Challenge in Ruby
https://github.com/adamdilek/robot-simulation
code-challenge ruby toy-robot-simulation
Last synced: 7 months ago
JSON representation
The Toy Robot Challenge in Ruby
- Host: GitHub
- URL: https://github.com/adamdilek/robot-simulation
- Owner: adamdilek
- Created: 2019-03-16T16:58:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T18:57:51.000Z (almost 7 years ago)
- Last Synced: 2025-03-17T10:04:43.894Z (11 months ago)
- Topics: code-challenge, ruby, toy-robot-simulation
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robot Simulator
## Run in your local
```
bundle install
ruby main.rb
```
## Run tests
```
bundle exec rspec
```
## Example Data
These examples can be find in example-data.txt
INPUTS
```
PLACE 1,1,EAST
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
REPORT
```
OUTPUT
```
Output: 4, 1, EAST
```
### ----------------------
INPUTS
```
PLACE 3,3,WEST
LEFT
MOVE
LEFT
MOVE
PLACE 1,1,NORTH
REPORT
```
OUTPUT
```
Output: 1, 1, NORTH
```
### ----------------------
INPUTS
```
PLACE 1,3,WEST
MOVE
MOVE
```
OUTPUT
```
The robot going to fall down. We did not move the robot anywhere.
```
### ----------------------
INPUTS
```
MOVE
```
OUTPUT
```
You should first place robot on the table.
```
### ----------------------
INPUTS
```
PLACE 0,0,NORTH
MOVE
REPORT
```
OUTPUT
```
Output: 0, 1, NORTH
```
### ----------------------
INPUTS
```
PLACE 0,0,NORTH
LEFT
REPORT
```
OUTPUT
```
Output: 0, 0, WEST
```