Class: Reversi::Player::Human
- Inherits:
-
BasePlayer
- Object
- BasePlayer
- Reversi::Player::Human
- Defined in:
- lib/reversi/player/human.rb
Instance Attribute Summary
Attributes inherited from BasePlayer
#board, #my_color, #opponent_color
Instance Method Summary collapse
-
#initialize(color, _board) ⇒ Human
constructor
A new instance of Human.
- #move(board) ⇒ Object
Methods inherited from BasePlayer
#count_disks, #next_moves, #put_disk, #status
Constructor Details
Instance Method Details
#move(board) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/reversi/player/human.rb', line 13 def move(board) return if next_moves.empty? puts board.to_s input_move printf "\e[#{18}A"; STDOUT.flush puts board.to_s; sleep 0.5 printf "\e[#{18}A"; STDOUT.flush end |