Skip to content

Instantly share code, notes, and snippets.

@wpietri
Created December 7, 2015 17:11
Show Gist options
  • Save wpietri/73bfae06403e13470388 to your computer and use it in GitHub Desktop.
Save wpietri/73bfae06403e13470388 to your computer and use it in GitHub Desktop.
Rover kata example for hiring
class Rover:
pass

We're going to build the API for a Mars rover using a test-driven approach. Some things that the rover could do:

* know which compass direction it is facing
* know where it is relative to its landing position
* move forward
* turn left and right
* sense whether there is an obstacle
* refuse to move forward if the path is blocked
* follow a list of single-character commands (f,l,r)
* move backward (b)
* anything else you think would be interesting
import unittest
from rover import Rover
class RoverTest(unittest.TestCase):
def testCreation(self):
self.assertIsNotNone(Rover())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment