programming-examples/ruby/_Basics/card_deck.rb
2019-11-15 12:59:38 +01:00

15 lines
351 B
Ruby

# Create a standard 52 card deck
# Sort card suits according to Hearts, Diamonds, Clubs, then Spades.
# Sort cards in ascending order, from 2 to Ace.
def create_deck
# Your code goes here
end
card_deck = create_deck
puts card_deck[0] == "2h" # 2 of Hearts
puts card_deck[8] == "10h" # 10 of Hearts
puts card_deck[51] == "As" # Ace of Spades