TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How would you keep track of a live poker tournament's state?

2 pointsby johnnyApplePRNGover 3 years ago
I am attempting to create an poker tournament software and I am getting hung up on how exactly to keep track of hands, dealer&#x2F;action position, tables, and tournaments.<p>In my eyes there are three things that need to be tracked.<p>Hands, which are a subset of Tables, which are a subset or Tournaments.<p>I&#x27;ve created the idea of a *<i>tournament_registration*</i> table that simply stores the *<i>account_id*</i> of the eager player and the *<i>tournament_size*</i> of the size of tournament they&#x27;re after.<p>Whenever a new *<i>account_id*</i> is added to the *<i>tournament_registration*</i> table for a certain *<i>tournament_size*</i>, I query the table after the insert to determine if enough players have registered for a certain tournament size.<p>That setup seems fairly optimal.<p>But when it comes to seating players at a table... I am confusing myself (probably overthinking this) as to how exactly to keep track of hand progression at each table.<p>Any help&#x2F;direction would be greatly appreciated.<p>Cheers!<p>I did try researching this of course, but any search for &quot;poker database best practices&quot; only turns up countless poker tracking softwares.<p>And unfortunately not many private poker websites talk at length about their setups.

1 comment

ssss11over 3 years ago
I think you summed it up with Hand is subset of Table is subset of Tournament.<p>When creating a new table randomise which Player sits where, with Dealer being a bot Player that has rules on how it plays its hand.<p>Keep an isActive on the Hands so you know who’s turn it is, and a sequential number so you know which order they sit in at the Table<p>If you focus on one Table and figure that out I think you’ll replicate it easily to a Tournament of Tables<p>Good luck! Sounds fun!<p>I made a pascal blackjack game in high school and this has brought back some fond memories of fun coding