Robojora
This is Enrique's Jora robot challenge. I have created a gem called Robojora
that contains:
- The logic required by the challenge.
- Automated testing.
- CI integration with Travis.
Installation
If you are going to test locally, I recommend you to:
$ gem install robojoraOr, if you want to add this to an app:
gem 'robojora'And then execute:
$ bundleUsage
Let's say you ran gem install robojora, now you can:
- Go to pry
$ pry- Require
robojora
> require 'robojora'From here you can start testing the code. First of all you have to build a board like this:
full_board = Robojora::Board.new.buildThen, create a robot like this:
robot = Robojora::Robot.new('tars')Now, tars can start playing a board like this:
robot.play_board(full_board)From here you can start placing the robot like this:
robot.place(3, 3, 'north')And then, you can continue rotating, moving, and reporting the report!
robot.left
robot.move
robot.reportLicense
The gem is available as open source under the terms of the MIT License.
