rook, queen, bishop moves
This commit is contained in:
parent
0ff179d9ff
commit
c4b4c7392f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,7 +2,7 @@ from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
class Bishop(Piece):
|
||||
def straightline_moves(self, piece, row, column):
|
||||
def bishop_moves(self, piece, row, column):
|
||||
self.direction = [
|
||||
(1, 1),
|
||||
(-1, -1),
|
||||
|
8
move.py
8
move.py
@ -73,7 +73,7 @@ class Move:
|
||||
#piece.delete_moves()
|
||||
piece.valid_moves=[]
|
||||
if piece.name == 'rook':
|
||||
Rook.straightline_moves(self, piece, row, column)
|
||||
Rook.rook_moves(self, piece, row, column)
|
||||
pass
|
||||
elif piece.name == 'pawn':
|
||||
Pawn.pawn_moves(self, piece, row, column)
|
||||
@ -82,11 +82,11 @@ class Move:
|
||||
Knight.knight_moves(self, piece, row, column)
|
||||
elif piece.name == 'bishop':
|
||||
pass
|
||||
Bishop.straightline_moves(self, piece, row, column)
|
||||
Bishop.bishop_moves(self, piece, row, column)
|
||||
elif piece.name == 'queen':
|
||||
pass
|
||||
Queen.straightline_moves(self, piece, row, column,True)
|
||||
Queen.straightline_moves(self, piece, row, column,False)
|
||||
Queen.queen_moves(self, piece, row, column,True)
|
||||
Queen.queen_moves(self, piece, row, column,False)
|
||||
elif piece.name == 'king':
|
||||
King.king_moves(self, piece, row, column)
|
||||
pass
|
||||
|
2
queen.py
2
queen.py
@ -2,7 +2,7 @@ from piece import Piece
|
||||
from board import Board
|
||||
from square import Square
|
||||
class Queen(Piece):
|
||||
def straightline_moves(self, piece, row, column, isvertical):
|
||||
def queen_moves(self, piece, row, column, isvertical):
|
||||
if isvertical is True:
|
||||
self.direction = [
|
||||
(0, 1),
|
||||
|
Loading…
Reference in New Issue
Block a user