
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Robulator is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
y
^
| NORTH
|
4 |---+---+---+---+
| | | | |
3 |---+---+---+---+
| | | | |
WEST 2 |---+---+---+---+ EAST
| | | | |
1 |---+---+---+---+
| | | | |
|---|---|---|---|----> x
0 1 2 3 4
SOUTH
Install it with:
$ gem install robulator
Start the toy robot simulator with:
$ robulator
Robulator accept commands in the following form:
PLACE X,Y,F
MOVE
LEFT
RIGHT
REPORT
Put the toy robot on the table in position X
,Y
and facing NORTH
, SOUTH
,
EAST
or WEST
.
The origin (0,0) is the SOUTH WEST
most corner.
The first valid command to the robot is a PLACE
command, after that,
any sequence of commands may be issued, in any order, including another
PLACE
command. Robulator discard all commands in the sequence until a
valid PLACE
command has been executed.
Move the toy robot one unit forward in the direction it is currently facing.
Rotate the robot 90 degrees in the specified direction without changing the position of the robot.
Announce the X
,Y
and the direction of the robot to standard output (e.g.
2,4,SOUTH
).
>> PLACE 0,0,NORTH
>> MOVE
>> REPORT
0,1,NORTH
>> PLACE 0,0,NORTH
>> LEFT
>> REPORT
0,0,WEST
>> PLACE 1,2,EAST
>> MOVE
>> MOVE
>> LEFT
>> MOVE
>> REPORT
3,3,NORTH
There are no other obstructions on the table surface.
The robot is free to roam around the surface of the table but it ignore commands that would cause the robot to fall, this also includes the initial placement of the toy robot, however further valid commands will be accepted.
A robot that is not on the table will ignore the MOVE
, LEFT
, RIGHT
and
REPORT
commands.
Robulator does not provide any graphical output showing the movement of the toy robot.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment. Run bundle exec robulator
to use the gem in this directory, ignoring other installed copies of this gem.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on Bitbucket at https://bitbucket.org/ixandidu/robulator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that robulator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.