rook, queen, bishop moves

This commit is contained in:
Agata Halik 2023-06-19 20:14:10 +02:00
parent 0ff179d9ff
commit c4b4c7392f
8 changed files with 7 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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),

View File

@ -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

View File

@ -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),

View File

@ -2,7 +2,7 @@ from piece import Piece
from board import Board
from square import Square
class Rook(Piece):
def straightline_moves(self, piece, row, column):
def rook_moves(self, piece, row, column):
self.direction = [
(0, 1),