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