Class: Human
Overview
Create Human player
Instance Attribute Summary
Attributes inherited from Player
Instance Method Summary collapse
-
#get_move ⇒ Object
Human version of get_move.
Methods inherited from Player
Constructor Details
This class inherits a constructor from Player
Instance Method Details
#get_move ⇒ Object
Human version of get_move
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rps_telwell/player.rb', line 33 def get_move = nil loop do puts || "Select your move:" move = gets.chomp.to_i if valid_move?(move) return move break else = "Invalid input, please enter a number 1-3" redo end end end |