Class: TicTacToe::AI
- Inherits:
-
Object
- Object
- TicTacToe::AI
- Defined in:
- lib/ttt/ai.rb
Instance Attribute Summary collapse
-
#difficulty ⇒ Object
Returns the value of attribute difficulty.
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
Instance Method Summary collapse
-
#initialize(mark, difficulty = :unbeatable_ai) ⇒ AI
constructor
A new instance of AI.
- #make_move(board) ⇒ Object
Constructor Details
#initialize(mark, difficulty = :unbeatable_ai) ⇒ AI
Returns a new instance of AI.
6 7 8 9 |
# File 'lib/ttt/ai.rb', line 6 def initialize(mark, difficulty = :unbeatable_ai) @mark = mark @difficulty = difficulty end |
Instance Attribute Details
#difficulty ⇒ Object
Returns the value of attribute difficulty.
4 5 6 |
# File 'lib/ttt/ai.rb', line 4 def difficulty @difficulty end |
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
3 4 5 |
# File 'lib/ttt/ai.rb', line 3 def mark @mark end |