HACKER Q&A
📣 torbet

How to Represent a Poker Game State?


In Chess we can represent a game as a FEN string or a PGN, is there any equivalent in poker?

If not, what are the values that make up the state of a poker hand? Cards dealt to each player, community cards, pot, etc.

How would you represent this in the most efficient way, whilst maintaining all of the necessary information?


  👤 gjvc Accepted Answer ✓

👤 edent
This sounds suspiciously like a University assignment.

Back in the USENET days, our tutors used to say that we were allowed to post questions to alt.programming.whatever - but we had to show that we'd put some thought into the question and explain where we got stuck.

Think of it like StackOverflow - if you post "how do I do X" you won't get great responses.

But if you write "I'm trying to do X. Using software Y fails with error Z. Googling the error suggests I need ... but I already have that installed. What should I do next?" you'll get better responses.

So, what ways have you tried to store a poker hand? What problems have you encountered?