Class: ChessData::Moves::QueensideCastles

Inherits:
Object
  • Object
show all
Defined in:
lib/chess_data/moves.rb

Overview

Methods to support queen-side castling move.

Instance Method Summary collapse

Instance Method Details

#make_move(board) ⇒ Object

Depending on the colour to move, will either castle queen-side for white or black. Returns a new instance of the board.



205
206
207
208
209
210
211
# File 'lib/chess_data/moves.rb', line 205

def make_move board
  if board.to_move == "w"
    white_castles board
  else
    black_castles board
  end
end

#to_sObject



199
200
201
# File 'lib/chess_data/moves.rb', line 199

def to_s
  "O-O-O"
end