Skip to content

Instantly share code, notes, and snippets.

View keppy's full-sized avatar
🧩

James Dominguez keppy

🧩
View GitHub Profile
def initialize(hands, cards)
ranks = %w{ 2 3 4 5 6 7 8 9 T J Q K A }
suits = %w{ S H D C }
card_stack = Array.new
h = Array.new
suits.each {|suit|
ranks.size.times {|i|
card_stack << (ranks[i]+suit)
}
}
@keppy
keppy / kpoker
Created May 29, 2012 20:34
poker game initialization
def initialize(numhands, n = 5, deck = [r+s for r in '23456789TJQKA' for s in 'SHDC'])
deck.shuffle
i = 0
numhands.times do (n*i).upto(n*(i+1)) {|x|... }
end
end