Fixed a few bugs and added laser mirror room generator.

This commit is contained in:
Niels Serup
2012-08-08 18:37:09 +02:00
parent 20e06e572e
commit 7666891baa
6 changed files with 157 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
from __future__ import print_function
import unittest
from robotgame.logic.lasermirror import *
from robotgame.logic.direction import *
class LaserMirrorTest(unittest.TestCase):
def test_playfield_generation(self):
print()
playfield = generate_simple_playfield(13)
print_playfield(playfield, 12, 12)
if __name__ == '__main__':
unittest.main()

View File

@@ -35,5 +35,11 @@ class RollingStoneTest(unittest.TestCase):
self.assertTrue(
reaches_goal(playfield, 10, 10, steps, (0, 0), (9, 9)))
print()
playfield, steps = generate_simple_playfield(10, 10, 4, 11)
print_playfield(playfield, 10, 10, True)
self.assertTrue(
reaches_goal(playfield, 10, 10, steps, (0, 0), (9, 9)))
if __name__ == '__main__':
unittest.main()