Skip to content

Instantly share code, notes, and snippets.

@ignu
Created December 4, 2009 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ignu/249310 to your computer and use it in GitHub Desktop.
Save ignu/249310 to your computer and use it in GitHub Desktop.
dealer.player = false
add_round do
players.each {|p| p.bet}
deal players 1.up
deal dealer 1.down
deal all 1.up
end
add_round do
players.each{ |p| p.act }
dealer.act
end
Player.actions do
bet do |amount|
player.pot += amount
end
hit do
deal player 1.up
end
double_down do
bet player.pot
hit
end
split do |s|
#ugh, this is going to be hard. :(
end
end
dealer.turn do
deal dealer 1.up until dealer.hand.total >= 17
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment