lib/board.rb
# Check if the parameter players is the winner
Check if the parameter players is the winner
Check if the parameter players is the winner
def winner?(player)
    COMBINATIONS.each do |combination|
      first, second, third = combination
      if @board[first] == @board[second] && @board[second] == @board[third] && @board[first] == player
        return true
      end
    end
    false
  end
def winner? ( player ) COMBINATIONS . each do | combination | first , second , third = combination if @board [ first ] == @board [ second ] && @board [ second ] == @board [ third ] && @board [ first ] == player return true end end false end
Check if the parameter players is the winner
Check if the parameter players is the winner
player
<not_specific>