module PlayRockPaperScissorsGame::PrivateMethods
Private Class Methods
final_outcome(pl, co)
click to toggle source
# File bin/PlayRockPaperScissorsGame, line 91 def final_outcome(pl, co) return :WIN if pl > co return :LOSE if pl < co return :TIE if pl = co end
player_choice()
click to toggle source
# File bin/PlayRockPaperScissorsGame, line 75 def player_choice loop do print ColorizedString["Choose rock (r), paper (p) or scissors (s): "].colorize(:green) choice = gets.chomp.downcase if Constants::NTRY_TO_SYM.key?(choice) return Constants::NTRY_TO_SYM[choice] elsif choice != Constants::VALID_ENTRIES puts ColorizedString["That entry is invalid. Please re-enter."].colorize(:green) end end end
player_outcome(plays)
click to toggle source
# File bin/PlayRockPaperScissorsGame, line 86 def player_outcome(plays) return :WIN if Constants::WINNERS.include?(plays) return :LOSE if Constants::LOSERS.include?(plays) return :TIE if !:WIN | !:LOSE end