Sha256: ba3e60e1e97af3c86978d0ad13c9c5fef90cd4812eb4c1db209132cfda527e3e

Contents?: true

Size: 767 Bytes

Versions: 41

Compression:

Stored size: 767 Bytes

Contents

require "colorized_string"
ColorizedString.colors   
ColorizedString.modes  
module Constants 
  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
  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

41 entries across 41 versions & 2 rubygems

Version Path
PlayRockPaperScissorsGame-2.2.4 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.2.3 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.2.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.2.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.2.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.9 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.8 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.7 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.6 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.5 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.4 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.3 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.2 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.1 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.1.0 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.0.9 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.0.8 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.0.7 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.0.6 lib/ref/Constants.rb
PlayRockPaperScissorsGame-2.0.5 lib/ref/Constants.rb