Class: HardAI
Instance Attribute Summary
Attributes inherited from AI
Instance Method Summary collapse
Methods inherited from AI
Constructor Details
This class inherits a constructor from AI
Instance Method Details
#move_generate ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/ttt-cli/strategies/hard_ai.rb', line 4 def move_generate if is_first_move? @board.even_cells.sample else minimax(@board, @computer) @best_move end end |