Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidpeach/rover
Answer to a technical test I did for a job interview.
https://github.com/davidpeach/rover
Last synced: 28 days ago
JSON representation
Answer to a technical test I did for a job interview.
- Host: GitHub
- URL: https://github.com/davidpeach/rover
- Owner: davidpeach
- Created: 2019-09-24T08:39:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-28T02:45:26.000Z (over 3 years ago)
- Last Synced: 2024-10-19T05:32:07.354Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 879 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mars Rover
## The Task
Firstly, determine a map grid with width and height.Then place a "Mars Rover" at a given position and facing direction on that grid. Then give it a set of directions:
- F = Forward
- L = Left
- R = Right
Finally report the Rover's final location along with the way it is facing. If it is off-grid, report it's last known location.This task was described in plain text and I was told to use any language and framework. I chose Laravel.
## Setup
```
git clone [email protected]:davidpeach/Rover.git
# or
git clone https://github.com/davidpeach/Rover.gitcd ./Rover
composer install
```## Running the Test Suite
```
./vendor/bin/phpunit
```
## Running
Below is an example of the questions it will ask you along with example responses you could give.
```
php artisan rover:setup
What is the map size?:
> # 4 8 (Map grid 4 blocks wide by 8 blocks high - zero indexed)Please give a mapping.:
> # (2, 3, N) FLLFRDo you wish to add another mapping? (yes/no) [no]:
> # yesPlease give a mapping.:
> # (1, 0, S) FFRLFDo you wish to add another mapping? (yes/no) [no]:
> # yesPlease give a mapping.:
> # (2, 2, N) RFLFFFFFFDo you wish to add another mapping? (yes/no) [no]:
> # no## You should then receive a response like this:
(2, 3, W)
(1, 0, S) LOST
(3, 7, N) LOST```