Skip to content

havenwood/deck-of-cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A deck of cards in Ruby.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages