-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (26 loc) · 684 Bytes
/
main.py
File metadata and controls
32 lines (26 loc) · 684 Bytes
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
import manager
import ai
import user
manager = manager.Manager()
user = user.User(manager)
while True:
move = None
depth = 0
if(manager.getColorTurn() == 'w'):
move = user.getMove()
else:
move = ai.generateMove(manager)
move = user.getMove()
manager.movePiece(move)
depth += 1
user.resetWithMessage("", [], (move.toPos[0], move.toPos[1]))
match(manager.status):
case "ongoing":
pass
case "stalemate":
user.resetWithMessage("The game has ended in a stalemate", [])
break
case "checkmate":
color = "White" if manager.winner == 'w' else "Black"
user.resetWithMessage(color + " has won the game", [])
break