diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 23:52:46 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 23:52:46 +0100 |
| commit | 7525fda5645e1e4debd79f3f4e0f453c657f49b7 (patch) | |
| tree | 95397031e0c7d4c2cd5c772ce682b1bbe9f481ab | |
| parent | v1.3.0: simplify payouts to bet x symbol x shape (diff) | |
| download | zagan-bet-7525fda5645e1e4debd79f3f4e0f453c657f49b7.tar.gz zagan-bet-7525fda5645e1e4debd79f3f4e0f453c657f49b7.zip | |
v1.3.1: allow = to increase the bet
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | docs/TESTING.md | 4 | ||||
| -rw-r--r-- | src/client/core.rs | 2 | ||||
| -rw-r--r-- | src/client/games/slots.rs | 3 | ||||
| -rw-r--r-- | tests/client_core.rs | 11 |
5 files changed, 17 insertions, 5 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "zagan-bet" | 2 | name = "zagan-bet" |
| 3 | version = "1.3.0" | 3 | version = "1.3.1" |
| 4 | edition = "2024" | 4 | edition = "2024" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
diff --git a/docs/TESTING.md b/docs/TESTING.md index acdcdd4..2a3572d 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md | |||
| @@ -43,8 +43,8 @@ Use an 80-column terminal because several output lines are width-sensitive. | |||
| 43 | yellow/bold `{ X }` cells; the `Winning lines:` list names the payline | 43 | yellow/bold `{ X }` cells; the `Winning lines:` list names the payline |
| 44 | (e.g. `4 (V)`). The controls line is never overwritten. Slots rules and RTP: | 44 | (e.g. `4 (V)`). The controls line is never overwritten. Slots rules and RTP: |
| 45 | `docs/SLOTS.md`. | 45 | `docs/SLOTS.md`. |
| 46 | 7. `+` / `-` after a spin changes only the bet; no stale grid or result lines | 46 | 7. `+` / `=` / `-` after a spin changes only the bet; no stale grid or result |
| 47 | appear. | 47 | lines appear. |
| 48 | 8. `q` clears the board. Ctrl+C in a game clears the board and exits. | 48 | 8. `q` clears the board. Ctrl+C in a game clears the board and exits. |
| 49 | 9. `info`, `ping`, `send hello`, and `hosts` print readable output; the host | 49 | 9. `info`, `ping`, `send hello`, and `hosts` print readable output; the host |
| 50 | fingerprint fits 80 columns. | 50 | fingerprint fits 80 columns. |
diff --git a/src/client/core.rs b/src/client/core.rs index c204cb2..a88991b 100644 --- a/src/client/core.rs +++ b/src/client/core.rs | |||
| @@ -204,7 +204,7 @@ impl ClientCore { | |||
| 204 | ] | 204 | ] |
| 205 | } | 205 | } |
| 206 | Key::Char(' ') => self.spin(), | 206 | Key::Char(' ') => self.spin(), |
| 207 | Key::Char('+') => { | 207 | Key::Char('+') | Key::Char('=') => { |
| 208 | let _ = self.game.adjust_bet(10); | 208 | let _ = self.game.adjust_bet(10); |
| 209 | self.board_effects() | 209 | self.board_effects() |
| 210 | } | 210 | } |
diff --git a/src/client/games/slots.rs b/src/client/games/slots.rs index ad9ef5c..d34bf49 100644 --- a/src/client/games/slots.rs +++ b/src/client/games/slots.rs | |||
| @@ -153,7 +153,8 @@ impl Game for SlotsGame { | |||
| 153 | \n\ | 153 | \n\ |
| 154 | Controls:\n\ | 154 | Controls:\n\ |
| 155 | SPACE - Spin the reels\n\ | 155 | SPACE - Spin the reels\n\ |
| 156 | +/- - Adjust total bet\n\ | 156 | + or = - Increase total bet\n\ |
| 157 | - - Decrease total bet\n\ | ||
| 157 | Q - Exit the game" | 158 | Q - Exit the game" |
| 158 | .to_string() | 159 | .to_string() |
| 159 | } | 160 | } |
diff --git a/tests/client_core.rs b/tests/client_core.rs index fd88566..4749d99 100644 --- a/tests/client_core.rs +++ b/tests/client_core.rs | |||
| @@ -172,6 +172,17 @@ fn spin_replaces_the_board_and_keeps_the_controls_line() { | |||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | #[test] | 174 | #[test] |
| 175 | fn equals_increases_the_bet_like_plus() { | ||
| 176 | let mut h = Harness::new(); | ||
| 177 | h.enter_slots("10"); | ||
| 178 | |||
| 179 | h.key(Key::Char('=')); | ||
| 180 | |||
| 181 | assert_eq!(h.board().len(), 10); | ||
| 182 | assert!(h.board()[1].contains("Bet: 20 PLN")); | ||
| 183 | } | ||
| 184 | |||
| 185 | #[test] | ||
| 175 | fn changing_the_bet_after_a_spin_does_not_leave_stale_lines() { | 186 | fn changing_the_bet_after_a_spin_does_not_leave_stale_lines() { |
| 176 | let mut h = Harness::new(); | 187 | let mut h = Harness::new(); |
| 177 | h.enter_slots("50"); | 188 | h.enter_slots("50"); |
