summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/GAMES.md43
-rw-r--r--docs/SERVER_SETUP.md5
-rw-r--r--docs/TESTING.md37
3 files changed, 59 insertions, 26 deletions
diff --git a/docs/GAMES.md b/docs/GAMES.md
index 2b8adf5..364cfef 100644
--- a/docs/GAMES.md
+++ b/docs/GAMES.md
@@ -79,19 +79,32 @@ Q forfeit an active hand (bet is lost), or leave when no hand is active
79## Roulette 79## Roulette
80 80
81- European wheel: 0-36, one green zero. 81- European wheel: 0-36, one green zero.
82- Bets: red, black, even, odd, and straight numbers. 82- The felt is drawn in full and bet with a cursor. Over the numbers the cursor
83- Bets can be split across all of those; every winning bet is added together. 83 sits on a *lattice point*, the way a chip sits between numbers on a real
84- Straight pays 35:1 (36x returned), outside bets pay 1:1 (2x returned). 84 felt: an inner point covers four numbers (corner), an edge point covers two
85- 0 loses all outside bets. RTP is 36/37 = 97.30%. 85 (split), and an outer corner is a straight.
86- Numbers are color-coded in the TUI: red numbers are red, 0 is green, and 86- Bet types and returns (per unit staked, stake included):
87 black numbers stay at the default terminal color. Bet amounts and balances 87
88 are not colored. 88 | Bet | Covers | Return |
89 | --- | --- | --- |
90 | Straight | one number | 36x |
91 | Split | two adjacent numbers | 18x |
92 | Corner | four numbers | 9x |
93 | Dozen | 1-12, 13-24, 25-36 | 3x |
94 | Column | 1,4,...,34 / 2,5,...,35 / 3,6,...,36 | 3x |
95 | Outside | 1-18, 19-36, EVEN, ODD, RED, BLACK | 2x |
96
97- 0 loses every outside bet, both dozens and every column. It pays a straight,
98 and split/corner bets containing 0 are not offered.
99- Every chip is settled independently and added together. RTP is 36/37 =
100 97.30% because every bet uses the same European odds.
101- Bet amounts and balances are not colored in the TUI.
89 102
90Client controls inside roulette: 103Client controls inside roulette:
91 104
92``` 105```
93R / B / E / O add the current chip to red/black/even/odd 106arrows move the cursor over the felt, including between numbers
94digits + Enter add the current chip to that number 107ENTER place the current chip on the cursor
95C clear all bets 108C clear all bets
96+ or = / - change the chip size 109+ or = / - change the chip size
97SPACE spin 110SPACE spin
@@ -125,7 +138,7 @@ plays (
125{"reels":"CCCCLLCLODGSDGS","win_type":"win","win_lines":"1","win_cells":"0,3,6"} 138{"reels":"CCCCLLCLODGSDGS","win_type":"win","win_lines":"1","win_cells":"0,3,6"}
126 139
127// roulette 140// roulette
128{"number":"17","color":"black","bets":"{\"red\":10,\"black\":10,\"even\":10,\"odd\":10,\"numbers\":[{\"number\":17,\"amount\":5}]}"} 141{"number":"17","color":"black","bets":"{\"chips\":[{\"target\":{\"bet\":\"outside\",\"kind\":\"red\"},\"amount\":10}]}"}
129 142
130// blackjack 143// blackjack
131{"player":["10S","6H","5D"],"dealer":["9D","8C"],"player_total":21,"dealer_total":17,"bet":10,"result":"win","winnings":20} 144{"player":["10S","6H","5D"],"dealer":["9D","8C"],"player_total":21,"dealer_total":17,"bet":10,"result":"win","winnings":20}
@@ -174,13 +187,21 @@ PLAY_START slots <bet>
174GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines> <win_cells> 187GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines> <win_cells>
175``` 188```
176 189
177Roulette adds a compact bets payload and a roulette-specific result: 190Roulette sends the chips and gets a roulette-specific result:
178 191
179``` 192```
180PLAY_START roulette <total> <bets-json> 193PLAY_START roulette <total> <bets-json>
181ROULETTE_RESULT <session> <winnings> <bet> <balance> <number> <color> <bets-json> 194ROULETTE_RESULT <session> <winnings> <bet> <balance> <number> <color> <bets-json>
182``` 195```
183 196
197`bets-json` is `{"chips":[{"target":{...},"amount":N}]}`. A target is one of
198`{"bet":"straight","number":17}`, `{"bet":"split","a":1,"b":2}`,
199`{"bet":"corner","numbers":[1,2,4,5]}`, `{"bet":"dozen","index":1}`,
200`{"bet":"column","index":0}` or
201`{"bet":"outside","kind":"red"}` (`low`, `high`, `even`, `odd`, `red`,
202`black`). The server rejects unknown, out-of-range or duplicate-number
203targets, and requires the total to equal the sum of the chips.
204
184Blackjack is a multi-step session: 205Blackjack is a multi-step session:
185 206
186``` 207```
diff --git a/docs/SERVER_SETUP.md b/docs/SERVER_SETUP.md
index 37d55b1..9eac7a7 100644
--- a/docs/SERVER_SETUP.md
+++ b/docs/SERVER_SETUP.md
@@ -79,9 +79,8 @@ last address for that key is forgotten.
79 79
80The server creates `server.db` in the current directory on first use. It holds 80The server creates `server.db` in the current directory on first use. It holds
81users, balances, and the per-game `plays` audit. The client keeps its own 81users, balances, and the per-game `plays` audit. The client keeps its own
82`client.db` for host fingerprints and stored credentials. Databases from before 82`client.db` for host fingerprints and stored credentials. There are no schema
83the fingerprint-keyed credentials are migrated on startup; rows whose host was 83migrations while the app is in alpha: a schema change means deleting both files.
84already forgotten cannot be re-keyed and require one fresh login.
85 84
86During development, delete both files to reset users, balances, history, and 85During development, delete both files to reset users, balances, history, and
87trust: 86trust:
diff --git a/docs/TESTING.md b/docs/TESTING.md
index fe302a9..7ec5b60 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -16,7 +16,7 @@ shared global database. Each test owns its state.
16| `tests/blackjack.rs` | Card totals, naturals, hit/stand/double, dealer bust, S17, state parsing. | 16| `tests/blackjack.rs` | Card totals, naturals, hit/stand/double, dealer bust, S17, state parsing. |
17| `tests/crash.rs` | Multiplier curve, payout floor, crash-point distribution, house edge, cap. | 17| `tests/crash.rs` | Multiplier curve, payout floor, crash-point distribution, house edge, cap. |
18| `tests/protocol.rs` | Newline buffering and timeout/error classification. | 18| `tests/protocol.rs` | Newline buffering and timeout/error classification. |
19| `tests/roulette.rs` | European wheel, split-bet payouts, zero handling, result parser. | 19| `tests/roulette.rs` | Wheel, every bet type and payout, zero handling, cursor lattice, result parser. |
20| `tests/server_core.rs` | Handler, bcrypt migration, SQL injection, transaction rollback, `plays` audit, sessions. | 20| `tests/server_core.rs` | Handler, bcrypt migration, SQL injection, transaction rollback, `plays` audit, sessions. |
21| `tests/server_setup.rs` | `--init` identity generation, PKCS#12 loadability, overwrite refusal. | 21| `tests/server_setup.rs` | `--init` identity generation, PKCS#12 loadability, overwrite refusal. |
22| `tests/slots.rs` | Server slots payout rules and overflow handling. | 22| `tests/slots.rs` | Server slots payout rules and overflow handling. |
@@ -71,18 +71,31 @@ Use an 80-column terminal because several output lines are width-sensitive.
71 71
72## Manual roulette checklist 72## Manual roulette checklist
73 73
741. `play roulette` shows the balance, chip size, empty bets, and controls. 741. `play roulette` draws the full felt: 0, the 3x12 numbers, dozens, columns,
752. `R`/`B`/`E`/`O` add one chip; digits + Enter add a number; `C` clears; 75 and the six outside cells, with the cursor on number 1.
76 `+`/`=`/`-` change the chip size. 762. Arrows move the cursor. On the numbers the highlighted cells show the bet:
773. Space scrolls the wheel under a fixed ball marker and ends on the winning 77 one number (straight), two (split), four (corner). Down leaves the felt into
78 the dozens, then columns, then outside; Up walks back.
793. ENTER places the chip where the cursor is; `C` clears; `+`/`=`/`-` change the
80 chip size. The bets line lists every chip and the total.
814. Space scrolls the wheel under a fixed ball marker and ends on the winning
78 number. 82 number.
794. Check a split result: 835. Check the payouts:
80 - `17 black odd`: black+odd pay, red+even lose, straight 17 pays 36x. 84 - a straight pays 36x, a split 18x, a corner 9x;
81 - `0`: all outside bets lose; a straight 0 pays 36x. 85 - a dozen or column pays 3x;
825. Numbers are color-coded: red numbers red, 0 green, black default. Check the 86 - an outside bet pays 2x;
83 bets line, the rolling strip, and the winning number. 87 - `0` loses every outside bet, both dozens and every column, and pays a
846. The result board shows the winning number/color/parity, the payout, and the 88 straight 0.
85 new balance. The next spin reuses the placed bets. 896. The result line names the number, color and parity, the total returned and
90 the profit. The next spin reuses the placed chips.
91
92## Manual terminal size check
93
941. Start the client in a terminal smaller than 80x24: it must print
95 `zagan.bet needs a terminal of at least 80x24 cells` and exit without
96 switching to the alternate screen or raw mode.
972. At 80x24 every game board (slots 10 lines, roulette 12, blackjack 6, crash 6)
98 must fit without wrapping.
86 99
87## Manual blackjack checklist 100## Manual blackjack checklist
88 101