lib/tak/board.rb
# Moves pieces according to PTN notation
#
# @param ptn [String]
#   String representation of a Tak move
#
# @param color [Symbol]
#   Which player is making the move
#
# @return [Boolean]
#   Success status
Moves pieces according to PTN notation
Moves pieces according to PTN notation
def move!(ptn, color)
      move = Tak::Move.new(ptn, self, color)
      return false unless move.valid? && square_owner(*move.origin)
      case move.type
      when 'movement'
        distribute_pieces(move)
      when 'placement'
        place_piece(move, color)
      end
    end
def move! ( ptn , color ) move = Tak :: Move . new ( ptn , self , color ) return false unless move . valid? && square_owner ( * move . origin ) case move . type when 'movement' distribute_pieces ( move ) when 'placement' place_piece ( move , color ) end end
Moves pieces according to PTN notation
Moves pieces according to PTN notation
None
Boolean
ptn
String representation of a Tak move
String representation of a Tak move
color
Which player is making the move
Which player is making the move