Sha256: d7ee6042b4e9865a2c04846a22c465a376685b149da7621033ea063904072cce

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

require "colorized_string"
ColorizedString.colors   
ColorizedString.modes  
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 = [
    ColorizedString["You are about to enter a rock-paper-scissors best of 3 match."].colorize(:green), 
    ColorizedString["Press the return/enter key to continue..."].colorize(:green), 
    ""
  ]
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
PlayRockPaperScissorsGame-2.2.8 lib/Constants.rb
PlayRockPaperScissorsGame-2.2.7 lib/Constants.rb