{"id":15770138,"url":"https://github.com/benbowes/toy-robot","last_synced_at":"2026-01-11T02:38:21.659Z","repository":{"id":42831819,"uuid":"159001218","full_name":"benbowes/toy-robot","owner":"benbowes","description":"NodeJS - Classic Toy Robot code test via command line","archived":false,"fork":false,"pushed_at":"2022-12-30T20:25:26.000Z","size":122,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-05T14:22:08.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/benbowes.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}},"created_at":"2018-11-25T05:34:14.000Z","updated_at":"2021-05-08T04:17:23.000Z","dependencies_parsed_at":"2023-01-31T15:45:39.754Z","dependency_job_id":null,"html_url":"https://github.com/benbowes/toy-robot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Ftoy-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Ftoy-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Ftoy-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Ftoy-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbowes","download_url":"https://codeload.github.com/benbowes/toy-robot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246465218,"owners_count":20781914,"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-04T14:22:15.559Z","updated_at":"2026-01-11T02:38:21.653Z","avatar_url":"https://github.com/benbowes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toy Robot (2018)\n\nThe application is a simulation of a toy robot moving on a square table top, of dimensions 5 units x 5 units. There are no other obstructions on the table surface. The robot is free to roam around the surface of the table, but is prevented from falling to destruction. Any movement that would result in the robot falling from the table is prevented, however further valid movement commands are still allowed.\n\nCommands are in the following form -\nPLACE X,Y,F\nMOVE\nLEFT\nRIGHT\nREPORT\n\nPLACE will put the toy robot on the table in position X,Y and facing NORTH, SOUTH, EAST or WEST. The origin (0,0)\nis considered to be the SOUTH WEST most corner.\nThe first 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 discards all commands in the sequence until a valid PLACE command has been executed.\nMOVE will move the toy robot one unit forward in the direction it is currently facing.\n\nLEFT and RIGHT rotate the robot 90 degrees in the specified direction without changing the position of the robot.\nREPORT announces the X,Y and F of the robot.\n\n### Pre-requisites\nThis project runs on NodeJS in a command line. You may need to install NodeJS via your prefered method (via brew, executable etc...) https://nodejs.org/en/\n\nThis project was built and tested using NodeJS v8.12.0. Any recent version of NodeJS should work.\n\n### Install the npm dependencies\n`cd` into this folder's root folder and run the following command to install all project dependencies\n\n```\nnpm install\n```\n\n### Running Toy Robot\nRun this command in your command line at the project's root.\n```\nnpm start\n```\n\nYou will be presented with a commnd prompt to enter commands.\n\n### Example Input and Output:\n```\nnpm start\n? Command.... PLACE 0,0,NORTH\n? Command.... MOVE\n? Command.... REPORT\n\nPosition: 0,1,NORTH\n```\n\n```\nnpm start\n? Command.... PLACE 0,0,NORTH\n? Command.... LEFT\n? Command.... REPORT\n\nPosition: 0,0,WEST\n```\n\n```\nnpm start\n? Command.... PLACE 1,2,EAST\n? Command.... MOVE\n? Command.... MOVE\n? Command.... LEFT\n? Command.... MOVE\n? Command.... REPORT\n\nPosition: 3,3,NORTH\n```\n\n### Running the tests\nRun this command in your command line at the project's root.\n```\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbowes%2Ftoy-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbowes%2Ftoy-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbowes%2Ftoy-robot/lists"}