pigeon-magnet-solver/pigeon_magnet_solver/main.py

25 lines
495 B
Python
Executable file

#!/usr/bin/python3
from .board import Board
from .solver import solve
def main() -> None:
solution = solve(
Board.default_puzzle,
lambda state: state.solution_class == (3, 1, 2),
# shuffle=True,
)
if solution is None:
print("Unsolvable!")
return
for btn, state in solution:
print(f"clicking button {btn} ...")
print(state)
print(state.solution_class, state.binary_repr)
if __name__ == "__main__":
main()