From 18bb23ad6d000260b2b0ec076ded3f4c71777e55 Mon Sep 17 00:00:00 2001 From: JoshHeaps Date: Tue, 1 Sep 2026 01:49:22 -0600 Subject: [PATCH] Pass the button to the next player, not the next chair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The button moved one seat per hand regardless of whether anyone was sitting there. At a ten-seat table with four players — an ordinary home game — it spent five hands out of eight on an empty chair. That reads as untidy, but the real problem is fairness. Position and the blinds are meant to come round to each player at the same rate. Rotating past empty chairs breaks that: a player with three empty seats to their right takes the button far less often than one sitting in a cluster, while both pay blinds every time the rotation reaches them. The button now skips to the next seat that's actually dealt in, so with four players it visits those four in turn and each takes it once every four hands. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb --- JoshHeaps.Net/wwwroot/js/casino/holdem/state.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/JoshHeaps.Net/wwwroot/js/casino/holdem/state.js b/JoshHeaps.Net/wwwroot/js/casino/holdem/state.js index 67b4a4e..666af2f 100644 --- a/JoshHeaps.Net/wwwroot/js/casino/holdem/state.js +++ b/JoshHeaps.Net/wwwroot/js/casino/holdem/state.js @@ -159,7 +159,20 @@ const HoldemState = { return ((fromIndex + delta) % count + count) % count; }, + // The button passes to the next player, not the next chair. Moving it one seat at + // a time parks it on empty chairs — with four players spread around ten seats it + // sits on nobody most hands — and that isn't only untidy: position and blinds are + // supposed to come round to each player at the same rate, and they don't if the + // button is rotating past chairs nobody is sitting in. advanceButton(state) { + for (let step = 1; step <= state.seatCount; step++) { + const index = this.nextSeatIndex(state, state.dealerSeatIndex, step); + if (state.seats[index].inHand) { + state.dealerSeatIndex = index; + return; + } + } + // Nobody is dealt in; move it along anyway so it doesn't look stuck. state.dealerSeatIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1); },