Created
January 15, 2010 04:59
-
-
Save ethangunderson/277822 to your computer and use it in GitHub Desktop.
This file contains 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
require 'java' | |
include_class com.bauer.backend.Card | |
include_class java.util.ArrayList | |
include_class java.util.Collections | |
include_class java.util.List | |
DECK_SIZE = 52 | |
SUIT_SIZE = 13 | |
SUITES = ['S','H','C','D'] | |
def create_deck | |
cards = ArrayList.new | |
SUIT_SIZE.times do |x| | |
SUITES.each {|suit| cards.add(create_card(suit,x))} | |
end | |
cards | |
end | |
def create_card(suit,number) | |
Card.new(suit,number) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment