samples/05_mouse/01_mouse_click/app/main.rb
# Checks if x or o won the game.
# If neither player wins and all nine squares are filled, a draw happens.
# Once a player is chosen as the winner or a draw happens, the game is over.
Checks if x or o won the game.
If neither player wins and all nine squares are filled, a draw happens.
Once a player is chosen as the winner or a draw happens, the game is over.
Checks if x or o won the game . If neither player wins and all nine squares are filled a draw happens . Once a player is chosen as the winner or a draw happens the game is over .
def determine_winner
    state.x_won = won? :x 
    state.o_won = won? :o
    state.draw = true if filled_spaces.length == 9 && !state.x_won && !state.o_won
    state.game_over = state.x_won || state.o_won || state.draw
  end
def determine_winner state . x_won = won? :x state . o_won = won? :o state . draw = true if filled_spaces . length == 9 && ! state . x_won && ! state . o_won state . game_over = state . x_won || state . o_won || state . draw end
Checks if x or o won the game.
Checks if x or o won the game .
# evaluates to either true or false (boolean values)