Skip to content

Instantly share code, notes, and snippets.

@ethangunderson
Created January 15, 2010 04:59
Show Gist options
  • Save ethangunderson/277822 to your computer and use it in GitHub Desktop.
Save ethangunderson/277822 to your computer and use it in GitHub Desktop.
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