Robot::Simulator
A robot simulator that can receive commands and move around on a table surface. It will prevent falling from the table, and can report its position.
Installation
Install it using gem:
$ gem install robot-simulator
Or directly from git repository:
$ git clone https://[email protected]/mingliangfeng/robot-simulator.git
$ cd robot-simulator
$ bundle install
$ bundle exec rspec
Environment
- Ruby version:
ruby 2.1.2p95, best to use rbenv to set the ruby version.
Dependencies
Usage
Use installation
Once installed, try the following, you will be asked for commands to instruct the robot to move:
$ robot-simulator
Or alternatively run robot simulator with commands from a text file:
$ robot-simulator -f /path/to/commands/text/file
Use source code
Get the source code from bitbucket as instructed in Installation section, go to robot-simulator folder and play straightaway:
$ bundle exec bin/robot-simulator
$ bundle exec bin/robot-simulator -f /path/to/commands/text/file
Design
Please see the class diagram here.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request