Skip to content

Instantly share code, notes, and snippets.

@cdave1
Created November 26, 2010 07:14
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 cdave1/716376 to your computer and use it in GitHub Desktop.
Save cdave1/716376 to your computer and use it in GitHub Desktop.
Noodling around with an idea, code is unfinished...
struct card { short suit, short value }
struct player { card first, card second }
struct middle { card flop1, card flop2, card flop3, card turn, card river }
player players[ ]
int my_position
card cards[52]
int cardCount
fun start(playerCount)
cards <- generate cards
players <- generatePlayers(playerCount)
my_position <- rand() % playerCount
end
fun iter()
cardCount = 52
# players hand don't change for each iteration
players[my_position].first <- cards[rand() % cardCount--]
players[my_position].second <- cards[rand() % cardCount--]
for each other player:
otherPlayer.first <- cards[rand() % cardCount--]
otherPlayer.second <- cards[rand() % cardCount--]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment