bin/PlayRockPaperScissorsGame in PlayRockPaperScissorsGame-2.2.2 vs bin/PlayRockPaperScissorsGame in PlayRockPaperScissorsGame-2.2.3
- old
+ new
@@ -19,11 +19,11 @@
protected
NTRY_TO_SYM = { 'p' => :PAPER, 'r' => :ROCK, 's' => :SCISSORS }
VALID_ENTRIES = NTRY_TO_SYM.keys
COMPUTER_CHOICES = NTRY_TO_SYM.values
WINNERS = [[:SCISSORS, :PAPER], [:PAPER, :ROCK], [:ROCK, :SCISSORS]] # format: player choice, computer choice
- LOSERS = WINNERS.map { |i,j| [j,i] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
+ LOSERS = WINNERS.map { |i,j| [j,i] } # this will take the original `WINNERS` array and flip the symbols, thus returning a loss for the user/player
INIT_STRINGS = ["You are about to enter a rock-paper-scissors best of 3 match.", "Press the return/enter key to continue...", ""]
end
class << self
def continue(str1, str2, str3)
@@ -86,10 +86,10 @@
def player_outcome(plays)
return :WIN if Constants::WINNERS.include?(plays)
return :LOSE if Constants::LOSERS.include?(plays)
return :TIE if !:WIN | !:LOSE
end
- def final_outcome(pl, co)
+ def final_outcome(pl,co)
return :WIN if pl > co
return :LOSE if pl < co
return :TIE if pl = co
end
end