Module: PrivateVars
- Defined in:
- lib/ref/PrivateVars.rb
Class Method Summary collapse
Class Method Details
.final_outcome(pl, co) ⇒ Object
17 18 19 20 21 |
# File 'lib/ref/PrivateVars.rb', line 17 def final_outcome(pl, co) return :WIN if pl > co; return :LOSE if pl < co; return :TIE if pl = co; end |
.player_choice ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/ref/PrivateVars.rb', line 4 def player_choice loop do print "Choose rock (r), paper (p) or scissors (s): "; choice = gets.chomp.downcase; return Constants::NTRY_TO_SYM[choice] if Constants::NTRY_TO_SYM.key?(choice); puts "That entry is invalid. Please re-enter"; end; end |