Play against bots

A live table. The reader has one seat; pkcore's bots play the rest. When a hand ends, the next one is dealt. This one is The Hand's table at the broadcast's stakes, with the reader in Negreanu's seat.

Theme
The Hand's table before the first hand.

What you need

Step 1: load the element

Put this line in the page once. Every table on the page shares it.

<script type="module" src="https://cdn.jsdelivr.net/npm/@imperialbower/bowery@0.3.0/bowery.js"></script>

To host it yourself, unpack bowery-vX.Y.Z.tar.gz from a release into a folder, for example bowery/, and load bowery/bowery.js instead. The element loads its wasm from the same folder.

Step 2: write the config

Save this as the-hand-play.yaml. It is the whole file.

# The Hand's table in play mode: the eight players at the broadcast's
# $300/$600 with a $100 ante, the reader in Negreanu's seat, seven bots.
mode: play
seat: 4
layout: ring
table: { seats: 8, button: 0, stakes: { small_blind: 300.0, big_blind: 600.0, ante: 100.0 } }
players:
  - { seat: 0, name: Doyle Brunson, stack: 100000, bot: tight_aggressive }
  - { seat: 1, name: Eli Elezra, stack: 100000, bot: loose_passive }
  - { seat: 2, name: Antonio Esfandiari, stack: 100000, bot: loose_aggressive }
  - { seat: 3, name: Gus Hansen, stack: 287100, bot: maniac }
  - { seat: 4, name: Daniel Negreanu, stack: 387100 }
  - { seat: 5, name: Cory Zeidman, stack: 100000, bot: tight_passive }
  - { seat: 6, name: Barry Greenstein, stack: 100000, bot: gto }
  - { seat: 7, name: Amnon Filippi, stack: 100000, bot: abc }
delay_ms: 500

Step 3: put the table in the page

<bowery-table src="the-hand-play.yaml">
  <img src="the-hand-play.svg" alt="The table before the first hand.">
</bowery-table>

To make a still picture for the fallback, run this in a clone of bowery:

cargo run --example bowery-still -- the-hand-play.yaml --view all > the-hand-play.svg

Step 4: serve the page

python3 -m http.server 8000

The bots

A bot is one of pkcore's profiles:

abc, gto, loose_aggressive, loose_passive, maniac, short_stack_ninja, tight_aggressive, tight_passive.

A player with no bot who is not the reader is played by gto.

Win percents

% shows every live seat's win percent, and with two seats left and one card to come, the trailing seat's outs; it is only there when every card is up. Play mode starts with odds off: the bots run on a timer, and a nine-way preflop step is a second of Monte Carlo in the browser. The reader turns them on with %, which is there when the config says view: all. The preflop percent is sampled, so it may differ from the figure bowery-still --odds prints.

Settings you can change

FieldValuesWhat it does
modeplayA live table. Needed.
table.seats2 to 10Chairs at the table.
table.buttona seatWhere the button starts.
table.stakessmall_blind, big_blind, anteWhole chips. The big blind is at least the small.
players{ seat, name, stack, bot }Who sits where. At least two.
seata seatThe reader. Default: the first player with no bot.
viewseat, allOnly the reader's cards up (default), or all of them.
layoutring, spotlight, ledgerHow the table is drawn. Default ring.
controls.oddstrue, falseShow the % button. Default: shown when the view is all.
deck52 cardsA stacked deck for hand 1. Later hands are shuffled.
seeda numberSeeds the bots and shuffles, so a page deals the same hands each time.
delay_msa numberMilliseconds between bot moves. Default 700.

Every field: Config on docs.rs.

Events

When a hand ends, the table sends bowery:hand-over:

document.addEventListener('bowery:hand-over', (event) => {
  console.log(event.target.id, 'hand over', event.detail.result);
});

This page's events: