- Java 43.6%
- TypeScript 32.5%
- Python 23.9%
|
|
||
|---|---|---|
| java | ||
| python | ||
| scenarios | ||
| ts | ||
| README.md | ||
| skyspell-ignore.toml | ||
Mars Rover Kata
Your Task
You’re part of the team that explores Mars by sending remotely controlled vehicles to the surface of the planet. You'll need to write some code to translate the commands sent from earth to instructions that are understood by the rover.
Requirements
- You are given the initial starting point (x,y) of a rover and the direction (N,S,E,W) it is facing.
- The rover receives a character array of commands.
- Implement commands that move the rover forward/backward (f,b).
- Implement commands that turn the rover left/right (l,r).
- Implement wrapping at edges.
- Implement obstacle detection before each move to a new square. If a given sequence of commands encounters an obstacle, the rover moves up to the last possible point, aborts the sequence and reports the obstacle.
Instructions
Part 1
Think hard about the architecture you would need to implement all the features (but don't write any code just yet!)
Draw a simple diagram featuring the classes, their methods and their relationships.
Part 2
-
Find a domain expert
-
Write test scenarios together - using a simple markdown file is enough
A scenario has 3 parts : "Given, When, Then" - and is a concrete example of one of the features above.
Note that you will need multiple scenarios per feature.
Part 3
Implement the features one by one, scenario per scenario, by:
- Converting the scenario into an automatic test
- Writing the production code to make the test pass
Part 4
When you're done implementing all the features, compare your code with the architecture you designed in part 1.
Credits
Inspired by: https://kata-log.rocks/mars-rover-kata (but the instructions here are slightly different)