{"id":16539496,"url":"https://github.com/al3rez/robot-ruby","last_synced_at":"2026-05-12T19:06:25.171Z","repository":{"id":197050064,"uuid":"697897317","full_name":"al3rez/robot-ruby","owner":"al3rez","description":"Toy Robot Simulator is a Ruby application that simulates a robot moving on a square tabletop, of dimensions 5 units x 5 units. The simulator reads in commands to place the robot on the table and to move, rotate, and report the robot’s position and facing direction.","archived":false,"fork":false,"pushed_at":"2023-09-28T17:52:52.000Z","size":698,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T20:37:26.641Z","etag":null,"topics":["challenge","rspec","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/al3rez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-28T17:41:14.000Z","updated_at":"2023-09-28T17:55:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3a5ebcd-86ef-477e-b0df-297a5678d5ac","html_url":"https://github.com/al3rez/robot-ruby","commit_stats":null,"previous_names":["al3rez/robot-ruby"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Frobot-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Frobot-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Frobot-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3rez%2Frobot-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al3rez","download_url":"https://codeload.github.com/al3rez/robot-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241773256,"owners_count":20018064,"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":["challenge","rspec","ruby"],"created_at":"2024-10-11T18:49:18.011Z","updated_at":"2026-05-12T19:06:20.134Z","avatar_url":"https://github.com/al3rez.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toy Robot Simulator ![Tests passing](https://github.com/al3rez/robot-ruby/actions/workflows/ruby.yml/badge.svg)\n\nThe Toy Robot Simulator is a Ruby application that simulates a robot moving on a square tabletop, of dimensions 5 units x 5 units. The simulator reads in commands to place the robot on the table and to move, rotate, and report the robot’s position and facing direction.\n![Showcase](demo.gif)\n\n\n## Table of Contents\n- [Files](#files)\n- [Usage](#usage)\n  - [Running the Simulator](#running-the-simulator)\n  - [Feeding Input](#feeding-input)\n- [Running Tests](#running-tests)\n- [Classes Description](#classes-description)\n  - [Command Processor](#command-processor)\n  - [Robot](#robot)\n  - [Table](#table)\n\n## Files\n- `bin/runner.rb`: The runner file to execute the simulator.\n- `command_processor.rb`: Processes and executes the input commands.\n- `robot.rb`: Represents the robot and handles its movement and rotation.\n- `table.rb`: Represents the tabletop and checks whether a position is valid on the table.\n\n## Usage\n\n### Running the Simulator\nTo run the simulator, navigate to the project directory in your terminal and run:\n```sh\n./bin/runner.rb\n```\n\n### Feeding Input\nAfter running the above command, you can enter the commands one by one, pressing enter after each command:\n\n```\nPLACE 1,2,NORTH\nMOVE\nRIGHT\nMOVE\nREPORT\n```\n\nType `EXIT` to exit the program.\n\nAlternatively, you can feed the commands from a file, commands.txt, by modifying the runner.rb as demonstrated in the earlier section.\n\n### Running Tests\nTo run the tests, navigate to the project directory in your terminal and run:\n\n```sh\n./bin/rspec\n```\n\n### Classes\n\n#### Command Processor\nThe CommandProcessor class is responsible for processing and executing the commands fed into the simulator. It interacts with the Robot and Table classes to perform actions such as placing the robot, moving it, and rotating it based on the provided commands.\n\n#### Robot\nThe Robot class represents the robot in the simulator. It holds information about the robot’s current position and facing direction and includes methods to move and rotate the robot.\n\n#### Table\nThe Table class represents the tabletop on which the robot moves. It provides a method to check whether a given position is within the boundaries of the table.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal3rez%2Frobot-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal3rez%2Frobot-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal3rez%2Frobot-ruby/lists"}