lib/chess/state.rb
###
# Checks if the game is over due to checkmate, stalemate, insufficient
# mating material, the seventyfive-move rule or fivefold repitition.
###
Checks if the game is over due to checkmate, stalemate, insufficient
mating material, the seventyfive-move rule or fivefold repitition.
Checks if the game is over due to checkmate stalemate insufficient mating material the seventyfive - move rule or fivefold repitition .
def game_over?
      if halfmove_clock >= 150
        return true
      end
      if insufficient_material?
        return true
      end
      return true if generate_legal_moves.empty?
      if fivefold_repitition?
        return true
      end
      return false
    end
def game_over? if halfmove_clock >= 150 return true end if insufficient_material? return true end return true if generate_legal_moves . empty? if fivefold_repitition? return true end return false end
Checks if the game is over due to checkmate, stalemate, insufficient
mating material, the seventyfive-move rule or fivefold repitition.
Checks if the game is over due to checkmate stalemate insufficient mating material the seventyfive - move rule or fivefold repitition .
# Seventyfive-move rule. # Insufficient material. # Stalemate or checkmate. # Fivefold repitition.