new1
This commit is contained in:
parent
dbc0363aa5
commit
157aa82794
Binary file not shown.
Binary file not shown.
38
board.py
38
board.py
@ -215,9 +215,39 @@ class Board:
|
||||
self.board.boardlist[self.final_row][self.final_column].piece = self.x
|
||||
self.board.boardlist[self.final_row][self.final_column].piece.moved = True
|
||||
self.board.boardlist[self.final_row][self.final_column].piece.delete_moves()
|
||||
#print(self.board.boardlist[self.final_row][self.final_column].piece.name)
|
||||
#print(self.initial_row, self.initial_column)
|
||||
#print(self.final_row, self.final_column)
|
||||
|
||||
self.ruch = str(self.initial_row) + str(self.initial_column) + ' ' + str(self.final_row) + str(self.final_column)
|
||||
if self.initial_column == 0:
|
||||
self.initial_column = "A"
|
||||
elif self.initial_column == 1:
|
||||
self.initial_column = "B"
|
||||
elif self.initial_column == 2:
|
||||
self.initial_column = "C"
|
||||
elif self.initial_column == 3:
|
||||
self.initial_column = "D"
|
||||
elif self.initial_column == 4:
|
||||
self.initial_column = "E"
|
||||
elif self.initial_column == 5:
|
||||
self.initial_column = "F"
|
||||
elif self.initial_column == 6:
|
||||
self.initial_column = "G"
|
||||
elif self.initial_column == 7:
|
||||
self.initial_column = "H"
|
||||
|
||||
if self.final_column == 0:
|
||||
self.final_column = "A"
|
||||
elif self.final_column == 1:
|
||||
self.final_column = "B"
|
||||
elif self.final_column == 2:
|
||||
self.final_column = "C"
|
||||
elif self.final_column == 3:
|
||||
self.final_column = "D"
|
||||
elif self.final_column == 4:
|
||||
self.final_column = "E"
|
||||
elif self.final_column == 5:
|
||||
self.final_column = "F"
|
||||
elif self.final_column == 6:
|
||||
self.final_column = "G"
|
||||
elif self.final_column == 7:
|
||||
self.final_column = "H"
|
||||
self.ruch = str(self.initial_column) + str(self.initial_row) + ' ' + str(self.final_column) + str(self.final_row)
|
||||
return self.ruch
|
42
game.py
42
game.py
@ -78,10 +78,44 @@ class Game:
|
||||
return Board.move_boot(self, 'black')
|
||||
|
||||
else:
|
||||
self.from_row = int(ruch[0])
|
||||
self.from_column=int(ruch[1])
|
||||
self.to_row=int(ruch[3])
|
||||
self.to_column=int(ruch[4])
|
||||
self.from_column = ruch[0]
|
||||
self.from_row = int(ruch[1])
|
||||
self.to_column = ruch[3]
|
||||
self.to_row = int(ruch[4])
|
||||
|
||||
if self.from_column == 'A':
|
||||
self.from_column = 0
|
||||
elif self.from_column == 'B':
|
||||
self.from_column = 1
|
||||
elif self.from_column == 'C':
|
||||
self.from_column = 2
|
||||
elif self.from_column == 'D':
|
||||
self.from_column = 3
|
||||
elif self.from_column == 'E':
|
||||
self.from_column = 4
|
||||
elif self.from_column == 'F':
|
||||
self.from_column = 5
|
||||
elif self.from_column == 'G':
|
||||
self.from_column = 6
|
||||
elif self.from_column == 'H':
|
||||
self.from_column = 7
|
||||
|
||||
if self.to_column == 'A':
|
||||
self.to_column = 0
|
||||
elif self.to_column == 'B':
|
||||
self.to_column = 1
|
||||
elif self.to_column == 'C':
|
||||
self.to_column = 2
|
||||
elif self.to_column == 'D':
|
||||
self.to_column = 3
|
||||
elif self.to_column == 'E':
|
||||
self.to_column = 4
|
||||
elif self.to_column == 'F':
|
||||
self.to_column = 5
|
||||
elif self.to_column == 'G':
|
||||
self.to_column = 6
|
||||
elif self.to_column == 'H':
|
||||
self.to_column = 7
|
||||
self.color = Board.move_rival(self, self.from_row, self.from_column, self.to_row, self.to_column)
|
||||
return Board.move_boot(self, self.color)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user