summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/SLOTS.md74
-rw-r--r--docs/TESTING.md10
2 files changed, 80 insertions, 4 deletions
diff --git a/docs/SLOTS.md b/docs/SLOTS.md
new file mode 100644
index 0000000..ccc3b60
--- /dev/null
+++ b/docs/SLOTS.md
@@ -0,0 +1,74 @@
1# Slots: 5 reels x 3 rows
2
3## Grid
4
5- 5 reels (columns) x 3 rows = 15 visible symbols.
6- Six symbols, uniform: `C` cherry, `L` lemon, `O` orange, `G` grapes,
7 `D` diamond, `S` seven.
8- The bet is the **total** bet, not a per-line bet.
9- Five paylines: top, middle, bottom, V, inverted V.
10- A line pays for 3, 4 or 5 matching symbols starting on reel 1 and reading
11 left to right.
12
13```
14line 1: top row across all five reels
15line 2: middle row across all five reels
16line 3: bottom row across all five reels
17line 4: top, middle, bottom, middle, top
18line 5: bottom, middle, top, middle, bottom
19```
20
21## Paytable
22
23Multipliers are applied to the total bet.
24
25| Symbol | 3 of a kind | 4 of a kind | 5 of a kind |
26| --- | ---: | ---: | ---: |
27| C | 2x | 5x | 15x |
28| L | 3x | 7x | 20x |
29| O | 3x | 8x | 25x |
30| G | 4x | 12x | 40x |
31| D | 6x | 18x | 70x |
32| S | 9x | 30x | 150x |
33
34- Exact RTP: **425/432 = 0.983796...** (1.62% house edge).
35- Maximum win: 5 lines x 150x = **750x total bet**.
36- Chance of any win on a spin: about **13%**.
37- The RTP is checked by `SlotsGame::theoretical_rtp()` and `tests/slots.rs`.
38
39## Wire format
40
41`GAME_RESULT` keeps its existing fields and appends the winning lines:
42
43```
44GAME_RESULT <session> <winnings> <bet> <balance> <reels> <win_type> <win_lines>
45```
46
47- `reels`: 15 characters, **column-major**: reel 0 top/middle/bottom, then
48 reel 1, and so on.
49- `win_type`: `none`, `win`, `big` (>= 10x total bet) or `mega` (>= 50x).
50- `win_lines`: 1-based comma-separated line numbers, or `-` for no win.
51- Older servers may still send a 3-character `reels` string; the client
52 degrades it to the first row.
53
54The extra `win_lines` field is additive, but the 5x3 `reels` payload is a
55breaking change for pre-5x3 clients. That is why the release is `1.0.0`.
56
57## Client board
58
59The board is nine lines:
60
61```
62=== SLOTS ===
63Bet: 10 PLN Lines: 5 Balance: 1000 PLN
64[ C ] [ L ] [ O ] [ G ] [ D ]
65[ S ] [ C ] [ L ] [ O ] [ G ]
66[ D ] [ S ] [ C ] [ L ] [ O ]
67
68Won 20 PLN
69Winning lines: 1, 3
70[+/-] Bet [SPACE] Spin [Q] Quit
71```
72
73`win_lines` is already carried through the client state so the next animation
74pass can highlight the winning rows without recomputing the payout.
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 55f5422..8fac851 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -36,10 +36,12 @@ Use an 80-column terminal because several output lines are width-sensitive.
36 prompt, Ctrl+C exits and restores the terminal. 36 prompt, Ctrl+C exits and restores the terminal.
374. `help` fits 80 columns. Tab completion wraps within 76 columns and the 374. `help` fits 80 columns. Tab completion wraps within 76 columns and the
38 cursor stays visible. 38 cursor stays visible.
395. `play slots 50` shows `Bet: 50 PLN` and the fetched balance. 395. `play slots 50` shows a 5x3 grid, `Lines: 5`, and the fetched balance.
406. Space shows `Spinning...`, then the reels, win text, and new balance inside 406. Space shows `Spinning...`, then the 3 rows, win text, winning-line list, and
41 the same 7-line board. The controls line is never overwritten. 41 new balance inside the same 9-line board. The controls line is never
427. `+` / `-` after a spin changes only the bet; no stale result lines appear. 42 overwritten. Slots rules and RTP: `docs/SLOTS.md`.
437. `+` / `-` after a spin changes only the bet; no stale grid or result lines
44 appear.
438. `q` clears the board. Ctrl+C in a game clears the board and exits. 458. `q` clears the board. Ctrl+C in a game clears the board and exits.
449. `info`, `ping`, `send hello`, and `hosts` print readable output; the host 469. `info`, `ping`, `send hello`, and `hosts` print readable output; the host
45 fingerprint fits 80 columns. 47 fingerprint fits 80 columns.