Uploaded my most recent versions of the amazons work.

This commit is contained in:
2023-06-28 14:22:44 -04:00
parent 86130ecc8b
commit c67ab96a52
8 changed files with 126 additions and 0 deletions

0
amazons/test/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

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):