Skip to content

Instantly share code, notes, and snippets.

View coxandrew's full-sized avatar

Andrew Cox coxandrew

View GitHub Profile
# Original module with "magic numbers" for 4 suits and 13 card values
# See: http://refactoring.com/catalog/replaceMagicNumberWithSymbolicConstant.html
module PlayingCards
SUITS = %w{ spades clubs hearts diamonds }
class Deck
attr_accessor :cards
def initialize