Method: Chess::Game#move
- Defined in:
- lib/chess/game.rb
#move(notation) ⇒ String Also known as: move=, <<
Note:
This add a new Board in the Chess::Game.
Make a move.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/chess/game.rb', line 59 def move(notation) = (notation) if [:from] move2([:from], [:to], [:promotion]) else super([:name], [:dis], [:to], [:promotion]) end rescue IllegalMoveError raise IllegalMoveError.new("Illegal move '#{notation}'\nStatus: #{self.status}\nPlayer turn #{self.active_player}\n#{self}") if ENV['DEBUG'] raise IllegalMoveError.new("Illegal move '#{notation}'") end |