Class: XO::AI::MinPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/xo/ai/min_player.rb

Instance Attribute Summary

Attributes inherited from Player

#token

Instance Method Summary collapse

Methods inherited from Player

#initialize, #non_terminal_score, #squashed_value, #terminal_score

Constructor Details

This class inherits a constructor from XO::AI::Player

Instance Method Details

#best_score(next_grids_scores) ⇒ Object



9
10
11
# File 'lib/xo/ai/min_player.rb', line 9

def best_score(next_grids_scores)
  next_grids_scores.min
end

#loser_valueObject



17
18
19
# File 'lib/xo/ai/min_player.rb', line 17

def loser_value
  1
end

#winner_valueObject



13
14
15
# File 'lib/xo/ai/min_player.rb', line 13

def winner_value
  -1
end