Skip to content

Instantly share code, notes, and snippets.

@mjc-gh
Created September 27, 2018 04:02
Show Gist options
  • Save mjc-gh/3d299b86e18287151ced0087f871bcb0 to your computer and use it in GitHub Desktop.
Save mjc-gh/3d299b86e18287151ced0087f871bcb0 to your computer and use it in GitHub Desktop.
Deck of Cards
class Card < Struct.new(:rank, :suit)
def inspect
"#{rank} of #{suit}s"
end
end
##
# Problem #1 -- create a deck of cards and shuffle it
##
##
# Problem #2 -- sort the deck of cards by suit (Spades, Hearts, Diamonds, Clubs) then rank
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment