Fixed a few bugs and added laser mirror room generator.
This commit is contained in:
15
tests/lasermirror_tests.py
Normal file
15
tests/lasermirror_tests.py
Normal 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()
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user