-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·36 lines (27 loc) · 898 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
from eps import EinsteinPuzzleSolver
from pcoperator import PCOperator
if __name__ == '__main__':
solver = EinsteinPuzzleSolver()
operator = PCOperator()
operator.launch_app()
number_of_games = 10
for i in range(number_of_games):
operator.start_new_game()
task = operator.dump_task()
# for l in task: print(l)
solver.load_task(task)
solver.solve()
if solver.is_solved():
operator.apply_solution(solver.dump_solution(), i == number_of_games - 1)
else:
print("Could not solve the puzzle")
break
# task = operator.dump_task()
# # for l in task: print(l)
# solver.load_task(task)
# solver.solve()
# if solver.is_solved():
# operator.apply_solution(solver.dump_solution())
# else:
# print("Could not solve the puzzle")