{"id":20932908,"url":"https://github.com/jferrl/mars-robot-simulator","last_synced_at":"2026-05-12T07:32:45.971Z","repository":{"id":40768948,"uuid":"262363905","full_name":"jferrl/mars-robot-simulator","owner":"jferrl","description":"Basic typescript proyect template with an example","archived":false,"fork":false,"pushed_at":"2023-01-06T05:22:11.000Z","size":372,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T19:26:12.787Z","etag":null,"topics":["jest","mars-robot-simulator","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jferrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-05-08T15:46:40.000Z","updated_at":"2021-07-20T13:55:26.000Z","dependencies_parsed_at":"2023-02-05T10:16:33.794Z","dependency_job_id":null,"html_url":"https://github.com/jferrl/mars-robot-simulator","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/jferrl%2Fmars-robot-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fmars-robot-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fmars-robot-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2Fmars-robot-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferrl","download_url":"https://codeload.github.com/jferrl/mars-robot-simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243325402,"owners_count":20273283,"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":["jest","mars-robot-simulator","nodejs","typescript"],"created_at":"2024-11-18T21:53:44.602Z","updated_at":"2026-05-12T07:32:40.952Z","avatar_url":"https://github.com/jferrl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mars Robot Simulator\n\n[![Build Status](https://travis-ci.org/jferrl/mars-robot-simulator.svg?branch=master)](https://travis-ci.org/jferrl/mars-robot-simulator)\n[![Maintainability](https://api.codeclimate.com/v1/badges/03835cd9e1424e8b026a/maintainability)](https://codeclimate.com/github/jferrl/mars-robot-simulator/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/03835cd9e1424e8b026a/test_coverage)](https://codeclimate.com/github/jferrl/mars-robot-simulator/test_coverage)\n\nThe main purpose of this repository is to show a basic end-to-end project setup and workflow for writing Node code with TypeScript.\nProyect structure based on [microsoft/TypeScript-Node-Starter](https://github.com/microsoft/TypeScript-Node-Starter)\n\n## Commands\n\nAll the different build steps are orchestrated via [npm scripts](https://docs.npmjs.com/misc/scripts).\n\n| Npm Script   | Description                                                         |\n| ------------ | ------------------------------------------------------------------- |\n| `start`      | Runs node on `dist/index.js` which is the apps entry point          |\n| `build`      | Full build. Runs ALL build tasks (`build-ts`)                       |\n| `test`       | Runs tests using Jest test runner                                   |\n| `watch-test` | Runs tests in watch mode                                            |\n| `build-ts`   | Compiles all source `.ts` files to `.js` files in the `dist` folder |\n\n## Description\n\nThe surface of Mars can be modelled by a rectangular grid around which robots are able to\nmove according to instructions provided from Earth. You are to write a program that\ndetermines each sequence of robot positions and reports the final position of the robot.\n\nA robot position consists of a grid coordinate (a pair of integers: x-coordinate followed by\ny-coordinate) and an orientation (N, S, E, W for north, south, east, and west).\nA robot instruction is a string of the letters “L”, “R”, and “F” which represent, respectively,\nthe instructions:\n    - Left : the robot turns left 90 degrees and remains on the current grid point.\n    - Right : the robot turns right 90 degrees and remains on the current grid point.\n    - Forward : the robot moves forward one grid point in the direction of the current\norientation and maintains the same orientation.\nThe direction North corresponds to the direction from grid point (x, y) to grid\npoint (x, y+1).\n\nThere is also a possibility that additional command types may be required in the future\nand provision should be made for this.\n\nSince the grid is rectangular and bounded (...yes Mars is a strange planet), a robot that\nmoves “off” an edge of the grid is lost forever. However, lost robots leave a robot “scent”\nthat prohibits future robots from dropping off the world at the same grid point. The scent\nis left at the last grid position the robot occupied before disappearing over the edge. An\ninstruction to move “off” the world from a grid point from which a robot has been\npreviously lost is simply ignored by the current robot.\n\n### The Input\n\nThe first line of input is the upper-right coordinates of the rectangular world, the lower-\nleft coordinates are assumed to be 0, 0.\n\nThe remaining input consists of a sequence of robot positions and instructions (two lines\nper robot). A position consists of two integers specifying the initial coordinates of the\nrobot and an orientation (N, S, E, W), all separated by whitespace on one line. A robot\ninstruction is a string of the letters “L”, “R”, and “F” on one line.\nEach robot is processed sequentially, i.e., finishes executing the robot instructions before\nthe next robot begins execution.\n\nThe maximum value for any coordinate is 50.\n\nAll instruction strings will be less than 100 characters in length.\n\n### The Output\n\nFor each robot position/instruction in the input, the output should indicate the final grid\nposition and orientation of the robot. If a robot falls off the edge of the grid the word\n“LOST” should be printed after the position and orientation.\n\n### Sample Input\n\n53\n\n11E RFRFRFRF\n\n32N FRRFLLFFRRFLL\n\n03W LLFFFLFLFL\n\n### Sample Output\n\n11E\n\n33NLOST \n\n23S\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fmars-robot-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferrl%2Fmars-robot-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fmars-robot-simulator/lists"}