Class: SimpleComputer
- Inherits:
-
Object
- Object
- SimpleComputer
- Defined in:
- lib/simple_computer.rb
Instance Attribute Summary collapse
-
#marker ⇒ Object
readonly
Returns the value of attribute marker.
Instance Method Summary collapse
- #choose_space(board) ⇒ Object
-
#initialize(marker) ⇒ SimpleComputer
constructor
A new instance of SimpleComputer.
Constructor Details
#initialize(marker) ⇒ SimpleComputer
Returns a new instance of SimpleComputer.
5 6 7 |
# File 'lib/simple_computer.rb', line 5 def initialize(marker) @marker = marker end |
Instance Attribute Details
#marker ⇒ Object (readonly)
Returns the value of attribute marker.
3 4 5 |
# File 'lib/simple_computer.rb', line 3 def marker @marker end |
Instance Method Details
#choose_space(board) ⇒ Object
9 10 11 |
# File 'lib/simple_computer.rb', line 9 def choose_space(board) board.check_available_spaces.sample end |