Class: ChessData::Moves::KingsideCastles
- Inherits:
-
Object
- Object
- ChessData::Moves::KingsideCastles
- Defined in:
- lib/chess_data/moves.rb
Overview
Methods to support king-side castling move.
Instance Method Summary collapse
-
#make_move(board) ⇒ Object
Depending on the colour to move, will either castle king-side for white or black.
- #to_s ⇒ Object
Instance Method Details
#make_move(board) ⇒ Object
Depending on the colour to move, will either castle king-side for white or black. Returns a new instance of the board.
146 147 148 149 150 151 152 |
# File 'lib/chess_data/moves.rb', line 146 def make_move board if board.to_move == "w" white_castles board else black_castles board end end |
#to_s ⇒ Object
140 141 142 |
# File 'lib/chess_data/moves.rb', line 140 def to_s "O-O" end |