programming-examples/ruby/Basics/card_deck.rb

15 lines
351 B
Ruby
Raw Normal View History

2019-11-18 14:44:36 +01:00
# 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