Skip to content

Instantly share code, notes, and snippets.

@tt293
Created May 17, 2020 14:37
Show Gist options
  • Save tt293/666abaec03b951b1d3cff7f4371a1c18 to your computer and use it in GitHub Desktop.
Save tt293/666abaec03b951b1d3cff7f4371a1c18 to your computer and use it in GitHub Desktop.
Leduc InformationSet representation
def get_representation(self) -> str:
player_index = self.get_index(self.get_active_player())
player_card_rank = self.deck[player_index][0]
actions_as_string = "/".join([str(x) for x in self.history])
if self.round == Round.pre_flop:
community_card_rank = ''
else:
community_card_rank = self.deck[-1][0]
return f'{player_card_rank}/{community_card_rank}-{actions_as_string}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment