Class: Rockpaperscissorsbattle::Player

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

Direct Known Subclasses

Computer

Instance Method Summary collapse

Instance Method Details

#pick(options) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/rockpaperscissorsbattle/player.rb', line 4

def pick(options)
  choice = nil
  until options.include?(choice)
    puts %Q;Enter "r", "p" or "s";
    choice = STDIN.noecho(&:gets).strip.to_sym
  end
  choice
end