{"id":16732677,"url":"https://github.com/igorescobar/toy-robot","last_synced_at":"2026-02-21T06:03:28.281Z","repository":{"id":33133086,"uuid":"36772630","full_name":"igorescobar/toy-robot","owner":"igorescobar","description":"A simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.","archived":false,"fork":false,"pushed_at":"2015-06-04T00:53:37.000Z","size":212,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T08:47:37.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorescobar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-03T01:36:58.000Z","updated_at":"2023-03-10T10:47:26.000Z","dependencies_parsed_at":"2022-07-13T00:10:34.924Z","dependency_job_id":null,"html_url":"https://github.com/igorescobar/toy-robot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorescobar%2Ftoy-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorescobar%2Ftoy-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorescobar%2Ftoy-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorescobar%2Ftoy-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorescobar","download_url":"https://codeload.github.com/igorescobar/toy-robot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243784099,"owners_count":20347409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:46:09.945Z","updated_at":"2025-10-18T06:26:58.182Z","avatar_url":"https://github.com/igorescobar.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby Toy Robot Simulator\n[![Build Status](https://travis-ci.org/igorescobar/toy-robot.svg?branch=master)](https://travis-ci.org/igorescobar/toy-robot)\n[![Code Climate](https://codeclimate.com/github/igorescobar/toy-robot/badges/gpa.svg)](https://codeclimate.com/github/igorescobar/toy-robot)\n[![Test Coverage](https://codeclimate.com/github/igorescobar/toy-robot/badges/coverage.svg)](https://codeclimate.com/github/igorescobar/toy-robot/coverage)\n\n## Description\n\nA simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.  See [Specification](#specification) below for details.\n\n## Installation\n    $ brew update\n    $ brew install rbenv ruby-build\n    $ rbenv install 2.1.6\n    $ gem install bundler\n    $ bundle install\n\n## Changelog\n\n    $ stepup changelog\n\n## Usage\n\n    $ bin/toy_robot interpret ./test_data/commands_1.txt\n\n## Testing\n\nCode quality is attempted by using [RSpec](http://rspec.info/) for testing, [SimpleCov](https://github.com/colszowka/simplecov) for code test coverage, [Rubocop](https://github.com/bbatsov/rubocop) for static code analyzer, [Reek](https://github.com/troessner/reek) to fix code smells, as well as [Code Climate](https://codeclimate.com/) for quality metrics.\n\nRun tests:\n\n    $ rspec\n\nCheck test coverage (after running rspec):\n\n    $ open coverage/index.html\n\nCheck code smells:\n\n    $ reek\n\nRubocop report:\n\n    $ open rubocop.html\n\n## Specification\n\n### Description\n- The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.\n- There are no other obstructions on the table surface.\n- The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement\nthat would result in the robot falling from the table must be prevented, however further valid movement commands must still\nbe allowed.\n\n*Create an application that can read in commands of the following form*\n`PLACE X,Y,F`\n`MOVE`\n`LEFT`\n`RIGHT`\n`REPORT`\n\n- `PLACE` will put the toy robot on the table in position `X,Y` and facing `NORTH`, `SOUTH`, `EAST` or `WEST`.\n- The origin (`0,0`) can be considered to be the `SOUTH WEST` most corner.\n- 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. The application should discard all commands in the sequence until a valid `PLACE` command has been executed\n- `MOVE` will move the toy robot one unit forward in the direction it is currently facing.\n- `LEFT` and `RIGHT` will rotate the robot 90 degrees in the specified direction without changing the position of the robot.\n- `REPORT` will announce the `X`,`Y` and `F` of the robot. This can be in any form, but standard output is sufficient.\n\n\u003cul\u003e\n\u003cli\u003eA robot that is not on the table can choose to ignore the \u003ccode\u003eMOVE\u003c/code\u003e, \u003ccode\u003eLEFT\u003c/code\u003e, \u003ccode\u003eRIGHT\u003c/code\u003e and \u003ccode\u003eREPORT\u003c/code\u003e commands.\u003c/li\u003e\n\u003cli\u003eInput can be from a file, or from standard input, as the developer chooses.\u003c/li\u003e\n\u003cli\u003eProvide test data to exercise the application.\u003c/li\u003e\n\u003c/ul\u003e\n\n### Constraints\nThe toy robot must not fall off the table during movement. This also includes the initial placement of the toy robot.\nAny move that would cause the robot to fall must be ignored.\n\nExample Input and Output:\n\na)\n`PLACE 0,0,NORTH`\n`MOVE`\n`REPORT`\nOutput: `0,1,NORTH`\n\nb)\n`PLACE 0,0,NORTH`\n`LEFT`\n`REPORT`\nOutput: `0,0,WEST`\n\nc)\n`PLACE 1,2,EAST`\n`MOVE`\n`MOVE`\n`LEFT`\n`MOVE`\n`REPORT`\nOutput: `3,3,NORTH`\n\n### Deliverables\nThe Ruby source files, the test data and any test code.\nIt is not required to provide any graphical output showing the movement of the toy robot.\n\n#### Copyright\n\nCopyright (c) 2015 Igor Escobar\n\nSee [MIT LICENSE](./LICENSE)  for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorescobar%2Ftoy-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorescobar%2Ftoy-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorescobar%2Ftoy-robot/lists"}