You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tooling.rst
+31-5Lines changed: 31 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,21 +12,34 @@ An example code snippet loading a PHH file in `PokerKit <https://doi.org/10.1109
12
12
13
13
from pokerkit import*
14
14
15
-
# Hand loading
16
-
17
-
withopen("...", "rb") asfile:
15
+
# Load hand
16
+
withopen("path/to/file.phh", "rb") asfile:
18
17
hh = HandHistory.load(file)
19
18
20
19
# Iterate through each action step
21
-
22
20
for state in hh:
23
21
...
22
+
23
+
An example code snippet loading a bulk PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below.
24
+
25
+
.. code-block:: python
26
+
27
+
from pokerkit import*
28
+
29
+
# Load hands
30
+
withopen("path/to/file.phhs", "rb") asfile:
31
+
hhs = HandHistory.load_all(file)
32
+
33
+
# Iterate through each hand history
34
+
for hh in hhs:
35
+
...
24
36
25
37
An example code snippet dumping a PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below. This hand, played between `Viktor Blom and Patrik Antonius <https://www.cardschat.com/news/10-largest-online-poker-pots-93487/>`_, holds the record for the largest online poker pot ever played.
26
38
27
39
.. code-block:: python
28
40
29
41
from pokerkit import*
42
+
30
43
A = Automation
31
44
# Game state construction
32
45
game = PotLimitOmahaHoldem(
@@ -75,6 +88,19 @@ An example code snippet dumping a PHH file in `PokerKit <https://doi.org/10.1109
75
88
game, state,
76
89
)
77
90
hh.players = ["Patrik Antonius", "Viktor Blom"]
91
+
78
92
# Dump hand
79
-
withopen("...", "wb") asfile:
93
+
withopen("path/to/file.phh", "wb") asfile:
80
94
hh.dump(file)
95
+
96
+
An example code snippet dumping a bulk PHH file in `PokerKit <https://doi.org/10.1109/TG.2023.3325637>`_ is shown below.
0 commit comments