Created
November 9, 2015 22:09
-
-
Save kenmazaika/99f8cdd343fe14bf556b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Deck | |
| RANKS = [:spades, :hearts, :diamonds, :clubs] | |
| SUITS = [2,3,4,5,6,7,8,9,10,"J","Q","k","A"] | |
| def initialize | |
| @cards = Array.new | |
| SUITS.each do |y| | |
| RANKS.each do |x| | |
| @cards << Card.new(x, y) | |
| end | |
| end | |
| end | |
| def shuffle | |
| @cards.shuffle! | |
| end | |
| def output | |
| @cards.each do |card| | |
| card.output_card | |
| end | |
| end | |
| def deal | |
| card = @cards.shift | |
| card.output_card | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment