Files
holdem_poker/assets/cards/9_of_hearts.svg
T
thejayman77 479be1f6b9 Initial commit: Hold'em engine, bots, and simulation harness
Kotlin Multiplatform engine (JVM target only for now; androidTarget and
iosArm64 slot in without touching commonMain).

Core:
- HandEvaluator: single-pass 5-7 card evaluation, ~24M evals/sec. Verified
  exhaustively against published frequencies for all 2,598,960 five-card hands.
- Equity: Monte Carlo with ties split. PreflopChart ranks the 169 starting
  hands using all-in equity plus an explicit playability adjustment, so
  looseness means "plays the top N%".
- Table: no-limit betting rounds, side pots, odd-chip splits, uncalled-bet
  refunds, and incomplete (short all-in) raises that correctly do not reopen
  betting.

Bots:
- SkillLevel and PlayStyle are orthogonal axes. Skill drives decision quality
  (rollout accuracy, pot-odds discipline, position awareness, error rate);
  style drives bluffing, sandbagging, aggression, tightness.
- BotMood gives tilt that persists between hands and decays.
- OpponentModel lets Advanced/Expert exploit habitual bettors.
- MathBot emits a DecisionTrace of the numbers behind each decision, which the
  coach will later hand to an LLM to narrate. The LLM never does poker maths.

Simulator:
- 2,200-3,400 hands/sec. Deck RNG is separate from bot RNGs so rollout counts
  cannot shift the deal.
- Controlled skill-ladder test asserts the difficulty gradient is monotonic:
  73.9 / 53.9 / 27.6 / -155.4 bb/100 over 50k hands.

Assets: 52 CC0 English-pattern card faces plus generated backs.

Tests: 30 passing (evaluator, table rules, pre-flop chart).

Known open: win-rate magnitudes ~10x realistic and several profiles looser
than their labels. Tuning, not correctness.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 04:36:03 -04:00

112 lines
9.0 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="360"
height="540"
id="svg20298">
<defs
id="defs20300">
<inkscape:path-effect
effect="spiro"
id="path-effect17935-89" />
<inkscape:path-effect
effect="spiro"
id="path-effect17939-8" />
<inkscape:path-effect
effect="spiro"
id="path-effect17935-8-7" />
<inkscape:path-effect
effect="spiro"
id="path-effect17939-6-0" />
</defs>
<metadata
id="metadata20303">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-151.42857,-248.08929)"
id="layer1">
<g
transform="translate(151.42857,-264.27289)"
id="g3089-8">
<rect
width="359"
height="539"
rx="29.944447"
ry="29.944447"
x="0.5"
y="512.86218"
id="rect6472-65"
style="fill:#ffffff;stroke:#000000;stroke-width:0.99999976" />
<path
d="m 30,592.36208 c 5.54,0 10,-4.46 10,-10 l 0,-20 0,-10 c 0,-5.54 -4.46,-10 -10,-10 -5.54,0 -10,4.46 -10,10 l 0,10 c 0,5.54 4.46,10 10,10 1.8226,0 3.5315,-0.4986 5,-1.3438 l 0,11.3438 c 0,2.77 -2.23,5 -5,5 -2.77,0 -5,-2.23 -5,-5 l 0,-1 -5,0 0,1 c 0,5.54 4.46,10 10,10 z m 0,-25 c -2.77,0 -5,-2.23 -5,-5 l 0,-10 c 0,-2.77 2.23,-5 5,-5 2.77,0 5,2.23 5,5 l 0,10 c 0,2.77 -2.23,5 -5,5 z"
id="rect3163-7-1-7-3-0-78-0"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 330,972.36208 c -5.54,0 -10,4.46 -10,10 l 0,20.00002 0,10 c 0,5.54 4.46,10 10,10 5.54,0 10,-4.46 10,-10 l 0,-10 c 0,-5.54 -4.46,-10.00002 -10,-10.00002 -1.8226,0 -3.5315,0.4986 -5,1.3438 l 0,-11.3438 c 0,-2.77 2.23,-5 5,-5 2.77,0 5,2.23 5,5 l 0,1 5,0 0,-1 c 0,-5.54 -4.46,-10 -10,-10 z m 0,25.00002 c 2.77,0 5,2.23 5,5 l 0,10 c 0,2.77 -2.23,5 -5,5 -2.77,0 -5,-2.23 -5,-5 l 0,-10 c 0,-2.77 2.23,-5 5,-5 z"
id="rect3163-7-1-7-3-0-78-1-2"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 89,575.36218 c 0,-11.04569 -5.71573,-18 -14,-18 -8.28427,0 -15,8.95431 -15,20 0.0349,0.95559 0.0182,1.89119 0,2.8125 0,7.29848 2.67685,14.37684 5,21 2.38903,6.81096 5.83357,12.78067 9.0625,18.875 5.00123,9.4394 15.9375,27.3125 15.9375,27.3125 0,0 10.93627,-17.8731 15.9375,-27.3125 3.22893,-6.09433 6.67347,-12.06404 9.0625,-18.875 2.32315,-6.62316 5,-13.70152 5,-21 -0.0284,-0.9744 -0.0186,-1.91462 0,-2.8125 0,-11.04569 -6.71573,-20 -15,-20 -8.28427,0 -14,6.95431 -14,18 0,2 -2,2 -2,0 z"
id="path3126-86"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 269,575.36218 c 0,-11.04569 -5.71573,-18 -14,-18 -8.28427,0 -15,8.95431 -15,20 0.0349,0.95559 0.0182,1.89119 0,2.8125 0,7.29848 2.67685,14.37684 5,21 2.38903,6.81096 5.83357,12.78067 9.0625,18.875 5.00123,9.4394 15.9375,27.3125 15.9375,27.3125 0,0 10.93627,-17.8731 15.9375,-27.3125 3.22893,-6.09433 6.67347,-12.06404 9.0625,-18.875 2.32315,-6.62316 5,-13.70152 5,-21 -0.0284,-0.9744 -0.0186,-1.91462 0,-2.8125 0,-11.04569 -6.71573,-20 -15,-20 -8.28427,0 -14,6.95431 -14,18 0,2 -2,2 -2,0 z"
id="path3126-17"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 89,695.36218 c 0,-11.04569 -5.71573,-18 -14,-18 -8.28427,0 -15,8.95431 -15,20 0.0349,0.95559 0.0182,1.89119 0,2.8125 0,7.29848 2.67685,14.37684 5,21 2.38903,6.81096 5.83357,12.78067 9.0625,18.875 5.00123,9.4394 15.9375,27.3125 15.9375,27.3125 0,0 10.93627,-17.8731 15.9375,-27.3125 3.22893,-6.09433 6.67347,-12.06404 9.0625,-18.875 2.32315,-6.62316 5,-13.70152 5,-21 -0.0284,-0.9744 -0.0186,-1.91462 0,-2.8125 0,-11.04569 -6.71573,-20 -15,-20 -8.28427,0 -14,6.95431 -14,18 0,2 -2,2 -2,0 z"
id="path3126-40"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 269,695.36218 c 0,-11.04569 -5.71573,-18 -14,-18 -8.28427,0 -15,8.95431 -15,20 0.0349,0.95559 0.0182,1.89119 0,2.8125 0,7.29848 2.67685,14.37684 5,21 2.38903,6.81096 5.83357,12.78067 9.0625,18.875 5.00123,9.4394 15.9375,27.3125 15.9375,27.3125 0,0 10.93627,-17.8731 15.9375,-27.3125 3.22893,-6.09433 6.67347,-12.06404 9.0625,-18.875 2.32315,-6.62316 5,-13.70152 5,-21 -0.0284,-0.9744 -0.0186,-1.91462 0,-2.8125 0,-11.04569 -6.71573,-20 -15,-20 -8.28427,0 -14,6.95431 -14,18 0,2 -2,2 -2,0 z"
id="path3126-94"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 179,755.36218 c 0,-11.04569 -5.71573,-18 -14,-18 -8.28427,0 -15,8.95431 -15,20 0.0349,0.95559 0.0182,1.89119 0,2.8125 0,7.29848 2.67685,14.37684 5,21 2.38903,6.81096 5.83357,12.78067 9.0625,18.875 5.00123,9.4394 15.9375,27.3125 15.9375,27.3125 0,0 10.93627,-17.8731 15.9375,-27.3125 3.22893,-6.09433 6.67347,-12.06404 9.0625,-18.875 2.32315,-6.62316 5,-13.70152 5,-21 -0.0284,-0.9744 -0.0186,-1.91462 0,-2.8125 0,-11.04569 -6.71573,-20 -15,-20 -8.28427,0 -14,6.95431 -14,18 0,2 -2,2 -2,0 z"
id="path3126-8"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 89,869.36218 c 0,11.04569 -5.71573,18 -14,18 -8.28427,0 -15,-8.95431 -15,-20 0.0349,-0.95559 0.0182,-1.89119 0,-2.8125 0,-7.29848 2.67685,-14.37684 5,-21 2.38903,-6.81096 5.83357,-12.78067 9.0625,-18.875 C 79.06373,815.23528 90,797.36218 90,797.36218 c 0,0 10.93627,17.8731 15.9375,27.3125 3.22893,6.09433 6.67347,12.06404 9.0625,18.875 2.32315,6.62316 5,13.70152 5,21 -0.0284,0.9744 -0.0186,1.91462 0,2.8125 0,11.04569 -6.71573,20 -15,20 -8.28427,0 -14,-6.95431 -14,-18 0,-2 -2,-2 -2,0 z"
id="path3126-82-0"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 269,869.36218 c 0,11.04569 -5.71573,18 -14,18 -8.28427,0 -15,-8.95431 -15,-20 0.0349,-0.95559 0.0182,-1.89119 0,-2.8125 0,-7.29848 2.67685,-14.37684 5,-21 2.38903,-6.81096 5.83357,-12.78067 9.0625,-18.875 5.00123,-9.4394 15.9375,-27.3125 15.9375,-27.3125 0,0 10.93627,17.8731 15.9375,27.3125 3.22893,6.09433 6.67347,12.06404 9.0625,18.875 2.32315,6.62316 5,13.70152 5,21 -0.0284,0.9744 -0.0186,1.91462 0,2.8125 0,11.04569 -6.71573,20 -15,20 -8.28427,0 -14,-6.95431 -14,-18 0,-2 -2,-2 -2,0 z"
id="path3126-4"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 89,989.3622 c 0,11.0457 -5.71573,18 -14,18 -8.28427,0 -15,-8.95431 -15,-20 0.0349,-0.95559 0.0182,-1.89119 0,-2.8125 0,-7.29848 2.67685,-14.37684 5,-21 2.38903,-6.81096 5.83357,-12.78067 9.0625,-18.875 C 79.06373,935.2353 90,917.36218 90,917.36218 c 0,0 10.93627,17.87312 15.9375,27.31252 3.22893,6.09433 6.67347,12.06404 9.0625,18.875 2.32315,6.62316 5,13.70152 5,21 -0.0284,0.9744 -0.0186,1.91462 0,2.8125 0,11.04569 -6.71573,20 -15,20 -8.28427,0 -14,-6.9543 -14,-18 0,-2 -2,-2 -2,0 z"
id="path3126-55"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 269,989.3622 c 0,11.0457 -5.71573,18 -14,18 -8.28427,0 -15,-8.95431 -15,-20 0.0349,-0.95559 0.0182,-1.89119 0,-2.8125 0,-7.29848 2.67685,-14.37684 5,-21 2.38903,-6.81096 5.83357,-12.78067 9.0625,-18.875 C 259.06373,935.2353 270,917.36218 270,917.36218 c 0,0 10.93627,17.87312 15.9375,27.31252 3.22893,6.09433 6.67347,12.06404 9.0625,18.875 2.32315,6.62316 5,13.70152 5,21 -0.0284,0.9744 -0.0186,1.91462 0,2.8125 0,11.04569 -6.71573,20 -15,20 -8.28427,0 -14,-6.9543 -14,-18 0,-2 -2,-2 -2,0 z"
id="path3126-1-2"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 29.5,611.36218 c 0,-5.52285 -2.857865,-9 -7,-9 -4.142135,0 -7.5,4.47715 -7.5,10 0.01745,0.4778 0.0091,0.94559 0,1.40625 0,3.64924 1.338425,7.18842 2.5,10.5 1.194515,3.40548 2.916785,6.39034 4.53125,9.4375 2.500615,4.7197 7.96875,13.65625 7.96875,13.65625 0,0 5.468135,-8.93655 7.96875,-13.65625 1.614465,-3.04716 3.336735,-6.03202 4.53125,-9.4375 1.161575,-3.31158 2.5,-6.85076 2.5,-10.5 -0.0142,-0.4872 -0.0093,-0.95731 0,-1.40625 0,-5.52285 -3.357865,-10 -7.5,-10 -4.142135,0 -7,3.47715 -7,9 0,1 -1,1 -1,0 z"
id="path3126-1-7-4"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
<path
d="m 329.5,953.36218 c 0,5.52285 -2.85787,9 -7,9 -4.14214,0 -7.5,-4.47715 -7.5,-10 0.0174,-0.4778 0.009,-0.94559 0,-1.40625 0,-3.64924 1.33842,-7.18842 2.5,-10.5 1.19452,-3.40548 2.91678,-6.39034 4.53125,-9.4375 2.50061,-4.7197 7.96875,-13.65625 7.96875,-13.65625 0,0 5.46814,8.93655 7.96875,13.65625 1.61446,3.04716 3.33673,6.03202 4.53125,9.4375 1.16157,3.31158 2.5,6.85076 2.5,10.5 -0.0142,0.4872 -0.009,0.95731 0,1.40625 0,5.52285 -3.35787,10 -7.5,10 -4.14214,0 -7,-3.47715 -7,-9 0,-1 -1,-1 -1,0 z"
id="path3126-1-1"
style="fill:#ff5555;fill-opacity:1;stroke:none" />
</g>
</g>
</svg>