Class: SimpleComputer

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_computer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#markerObject (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