Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
zachartrand committed Mar 19, 2021
1 parent e023d15 commit bed6e37
Show file tree
Hide file tree
Showing 4 changed files with 623 additions and 298 deletions.
8 changes: 8 additions & 0 deletions chess_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def set_piece(self, piece):

def remove_piece(self):
'''Removes the piece from the square.'''
self.piece.square = None
self.piece = None

def get_board(self):
Expand Down Expand Up @@ -177,6 +178,9 @@ def has_enemy_piece(self, piece):

return False

def is_selected(self):
return self.selected


class Board:
'''
Expand Down Expand Up @@ -206,6 +210,10 @@ def __init__(self, numFiles=8, numRanks=8):
self.squares = np.array(
emptyBoard, dtype=object
).reshape((self.files, self.ranks))
# Make attributes for each of the kings. Will be set when the board is
# generated. Will be used for checks and pins.
self.white_king = None
self.black_king = None

def get_size(self):
'''
Expand Down
Loading

0 comments on commit bed6e37

Please sign in to comment.