-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayerVsPlayer.py
43 lines (38 loc) · 1.34 KB
/
PlayerVsPlayer.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
35
36
37
38
39
40
41
42
43
############################################################
###PlayerVsPlayer.py Player vs player file ###
###Written by Nicholas Maselli ###
### ###
###Purpose: Allows a player to play against another ###
###human player. ###
### ###
###Version: 1.0 ###
###Date: 6-30-17 ###
############################################################
from chess import Chess
#########################################################################
########## Code for playing the game against a human player ########
#########################################################################
def PlayerVsPlayer(startState = None):
chess = Chess()
chess.print_board()
#Allows play from a specific state
if (startState != None):
chess.input_state()
chess.print_board()
#Play Chess!
while(True):
move = input('Input move: ')
move = chess.convert_move(move)
game = chess.move(move)
if (game == None
print(print_move)
chess.print_board()
return(chess)
elif (game == False):
continue
else:
chess.print_board()
return(chess)
def main():
PlayerVsPlayer()
main()