Sha256: b1079074b4d0d813949876533824c0592f8a7c672992512ab748ed5535a8ed7a

Contents?: true

Size: 650 Bytes

Versions: 19

Compression:

Stored size: 650 Bytes

Contents

protected;
module Constants 
  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
  INIT_STRINGS = [
    "You are about to enter a rock-paper-scissors best of 3 match.".green.bold, 
    "Press the return/enter key to continue...".green.bold, 
    ""
  ];
end;

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
PlayRockPaperScissorsGame-1.6.7 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.6 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.5 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.4 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.3 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.6.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.9 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.8 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.7 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.6 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.5 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.4 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.3 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.5.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.4.9 lib/ref/Constants.rb