Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Figure:
- def __init__(self, row, col, color):
- self.row = row
- self.col = col
- self.color = color
- def set_position(self, row, col):
- self.row = row
- self.col = col
- def get_color(self):
- return self.color
- def correct_move(self, row, col):
- return 0 <= row < 8 and 0 <= col < 8
- class Bishop(Figure):
- def char(self):
- return 'B'
- def can_move(self, row, col):
- if self.correct_move(row, col) and abs(self.row - row) == abs(self.col - col):
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement