https://github.com/bulkan/robot-simulation
Just a simple robot simulation
https://github.com/bulkan/robot-simulation
Last synced: 21 days ago
JSON representation
Just a simple robot simulation
- Host: GitHub
- URL: https://github.com/bulkan/robot-simulation
- Owner: bulkan
- Created: 2023-08-24T08:01:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-24T11:35:21.000Z (almost 3 years ago)
- Last Synced: 2025-01-05T19:42:16.667Z (over 1 year ago)
- Language: TypeScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robot Simulation
Simple robot simulation app command-line.
I used the following versions of node & yarn.
```
"node": "~18.17",
"yarn": ">=1.22.0"
```
To run first install dependencies.
```
yarn install
```
Run the tests to ensure it's working as expected
```
yarn test
```
Then run by;
```
yarn simulate [commands-file]
```
An example run would be;
```
yarn simulate ./samples/1.txt
```
# Notes / Assumptions
- This isn't a proper CLI in the sense that it should probably use `yarn link` along with the `bin` section in `package.json` as we just run it via `yarn simulate`
- I added support for `# comment` lines in the input file
- I've assumed that if the PLACE command puts the robot into an out bounds placement it will just start at 0,0 facing NORTH. For example given a 5x5 tabletop and PLACE 6,0,NORTH will place the bot at 0,0,NORTH
- As the origin is (0,0) (SOUTH WEST most corner) then in a 5x5 tabletop (4,4) is the x,y position for the top right corner (NORTH EAST)