Sha256: 25c308227753d66f408db16aa710d207a58e0ec8ab7791e50feb74fe5fd443a8

Contents?: true

Size: 617 Bytes

Versions: 15

Compression:

Stored size: 617 Bytes

Contents

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.", 
    "Press the return/enter key to continue...", 
    ""
  ];
end;

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
PlayRockPaperScissorsGame-1.4.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.4.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.4.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.9 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.8 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.7 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.6 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.5 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.4 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.3 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.3.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.2.9 lib/ref/Constants.rb
PlayRockPaperScissorsGame-1.2.8 lib/ref/Constants.rb