Class: HumanPlayer

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

Instance Method Summary collapse

Constructor Details

#initialize(board) ⇒ HumanPlayer

Returns a new instance of HumanPlayer.



4
5
6
# File 'lib/human_player.rb', line 4

def initialize(board)
  @game_board = board
end

Instance Method Details

#move(row, column) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/human_player.rb', line 8

def move(row, column)
  if @game_board.is_empty_at?(row, column)
    @game_board.move(row,column)
    return true
  end
  return false
end