2023-08-18 18:05:23 +00:00
|
|
|
from pigeon_magnet_solver.board import Board
|
|
|
|
|
|
|
|
|
|
|
|
def test_default():
|
|
|
|
board = Board.default_puzzle
|
|
|
|
|
|
|
|
assert board.height == 4, "Wrong height"
|
2023-08-18 18:41:58 +00:00
|
|
|
assert board.width == 3, "Wrong width"
|
|
|
|
|
|
|
|
assert board.columns == ("001x", "1101", "110x"), "Wrong columns"
|
|
|
|
assert board.binary_repr == (4, 11, 3), "Wrong binary repr"
|
|
|
|
assert board.solution_class == (1, 3, 2), "Wrong solution class"
|
2023-08-18 20:12:22 +00:00
|
|
|
|
2023-08-30 00:49:32 +00:00
|
|
|
assert (board2 := board.click(4)) is not None
|
|
|
|
assert board2.binary_repr == (4, 14, 3)
|
|
|
|
|
|
|
|
assert (board2 := board.click(5)) is not None
|
|
|
|
assert board2.binary_repr == (4, 11, 6)
|
2023-08-27 21:52:48 +00:00
|
|
|
|
2023-08-18 22:35:10 +00:00
|
|
|
for idx in (3, 7):
|
2023-08-30 00:49:32 +00:00
|
|
|
assert board.click(idx) is None
|