Sha256: a4f66ac40075f01a608272dc3e914e97a4fbead65d6e1323bb996ebb7c50af6d

Contents?: true

Size: 498 Bytes

Versions: 3

Compression:

Stored size: 498 Bytes

Contents

module AwesomeGameRandomizer
  class PlayingCard
    def self.draw
      suits = ["\u2660 Spades", "\u2665 Hearts", "\u2666 Diamonds", "\u2663 Clubs"]
      value = rand(2..14)
      case value
      when 11
        return "Jack of #{suits.sample}"
      when 12
        return "Queen of #{suits.sample}"
      when 13
        return "King of #{suits.sample}"
      when 14
        return "Ace of #{suits.sample}"
      else
        return "#{value} of #{suits.sample}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
awesome_game_randomizer-0.1.3 lib/awesome_game_randomizer/draw_a_card.rb
awesome_game_randomizer-0.1.2 lib/awesome_game_randomizer/draw_a_card.rb
awesome_game_randomizer-0.1.1 lib/awesome_game_randomizer/draw_a_card.rb