Class: HumanPlayer
- Inherits:
-
Object
- Object
- HumanPlayer
- Defined in:
- lib/human_player.rb
Instance Method Summary collapse
-
#initialize(board) ⇒ HumanPlayer
constructor
A new instance of HumanPlayer.
- #move(row, column) ⇒ Object
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 |