Class: Human
Instance Attribute Summary
Attributes inherited from Player
Instance Method Summary collapse
Methods inherited from Player
Constructor Details
This class inherits a constructor from Player
Instance Method Details
#move_for(board) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/nick_tac_toe/human.rb', line 2 def move_for(board) puts "Where will you move? Pick an empty space, 1-9." move_choice = gets.chomp.to_i while !board.valid_move?(move_choice) puts "That is not a valid move!" move_choice = gets.chomp.to_i end return move_choice - 1 end |