def test_sanity(self): for dirname in self.directions: d = Direction(dirname) for x in range(4): d.turn_left() self.assertEqual(d, Direction(dirname)) for x in range(4): d.turn_right() self.assertEqual(d, Direction(dirname))
def test_sanity(self): c = Coords(1,1) d = Direction('n') for x in range(4): c = c.get_offset(d, 5) d.turn_left() self.assertEqual(c, Coords(1,1)) for x in range(4): c = c.get_offset(d, -1) d.turn_right() self.assertEqual(c, Coords(1,1))
def test_turns(self): d = Direction('n') d.turn_left() self.assertEqual(d, Direction('w')) d.turn_right() self.assertEqual(d, Direction('n'))