At this point I think everything except for amazons-works can be deleted, but I'm hanging onto my mess for a bit before doing the dishes later, just in case.

This commit is contained in:
2023-06-29 12:45:50 -04:00
parent f2000deb40
commit 56f1eb564c
31 changed files with 1598 additions and 32 deletions

View File

View File

@@ -0,0 +1,39 @@
from unittest import TestCase
from board import Board
class TestBoard(TestCase):
def setUp(self):
self.board = Board()
self.tiny = Board()
self.tiny.state = [[3,0], [0,2]]
def test_board_size_is_correct(self):
self.assertEqual(len(self.board.state), 4)
def test_in_bounds_works(self):
bad = [
(-1, 1), (5, 1)
]
good = [
(2, 2), (0, 0), (3, 3)
]
for square in bad:
self.assertFalse(self.board.in_bounds(square))
for square in good:
self.assertTrue(self.board.in_bounds(square))
def test_get_initial_state(self):
def test_get_active_player_code(self):
def test_get_active_amazons_positions(self):
def test_possible_moves(self):
def test_get_successor_state(self, move_and_burn):
def test_get_possible_successor_states(self):
def test_is_empty(self, square):
def test_get_reachable_squares(self, amazon):