A deck of cards in Ruby.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.travis.yml
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
deck-of-cards.gemspec

README.md

Deck of Cards

Build Status Code Climate

Installation

gem install deck-of-cards

Usage

require 'deck-of-cards'

deck = DeckOfCards.new
# => #<Deck:0x007fa6d4187e78
# @cards=
#  [#<2 of Hearts>,
#   #<3 of Hearts>,
#   #<4 of Hearts>,
#   #<5 of Hearts>,
#   '...']>

deck.shuffle
# => [#<Ace of Clubs>,
# #<9 of Spades>,
# #<10 of Spades>,
# #<Queen of Clubs>,
# #...,

deck.split
# => [#<7 of Hearts>,
# #<4 of Diamonds>,
# #<King of Diamonds>,
# #<4 of Clubs>,
# #...,

my_card = deck.draw
# => #<7 of Hearts>

your_card = deck.draw
# => #<King of Diamonds>
	
my_card > your_card
# => false

my_card <= your_card
# => true

my_card == your_card
# => false