-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (20 loc) · 775 Bytes
/
main.py
File metadata and controls
25 lines (20 loc) · 775 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
# coding=utf-8
# import functions written in Chess.py
from Chess import *
def main():
# MAIN LOGIC
# before the game Starts
visual = True
board = create_pieces(3)
turn = 'w' # game starts with white
while no_winner(board): # While the game is running
if visual:
clear() # this makes playing much more enjoyable.
display_board(board)
ma = read_move(board, turn) # Read in the move from the Player (x1, y1, x2, y2)
valid_move, board = move(board, ma[0], ma[1], ma[2], ma[3]) # attempt to make the move
if valid_move:
turn = rotate_turn(turn) # At the end of the turn, rotate it
else:
print("NOT A VALID MOVE, TRY AGAIN!")
main()