Class: Chess::Pieces::Bishop
- Includes:
- BishopMoves
- Defined in:
- lib/chess/pieces/bishop.rb
Overview
Bishop
Instance Attribute Summary
Attributes inherited from Piece
Instance Method Summary collapse
-
#possible_moves(board) ⇒ Array
all possible_moves of Bishop.
Methods included from BishopMoves
#north_east_moves, #north_west_moves, #south_east_moves, #south_west_moves
Methods inherited from Piece
Constructor Details
This class inherits a constructor from Chess::Pieces::Piece
Instance Method Details
#possible_moves(board) ⇒ Array
all possible_moves of Bishop
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/chess/pieces/bishop.rb', line 66 def possible_moves(board) file = @pos[0] rank = @pos[1] moves = [] moves += north_west_moves(board, file, rank) moves += north_east_moves(board, file, rank) moves += south_west_moves(board, file, rank) moves += south_east_moves(board, file, rank) moves end |