From 7525fda5645e1e4debd79f3f4e0f453c657f49b7 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:52:46 +0100 Subject: v1.3.1: allow = to increase the bet --- Cargo.toml | 2 +- docs/TESTING.md | 4 ++-- src/client/core.rs | 2 +- src/client/games/slots.rs | 3 ++- tests/client_core.rs | 11 +++++++++++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4a9daea..f9e56f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zagan-bet" -version = "1.3.0" +version = "1.3.1" edition = "2024" [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. yellow/bold `{ X }` cells; the `Winning lines:` list names the payline (e.g. `4 (V)`). The controls line is never overwritten. Slots rules and RTP: `docs/SLOTS.md`. -7. `+` / `-` after a spin changes only the bet; no stale grid or result lines - appear. +7. `+` / `=` / `-` after a spin changes only the bet; no stale grid or result + lines appear. 8. `q` clears the board. Ctrl+C in a game clears the board and exits. 9. `info`, `ping`, `send hello`, and `hosts` print readable output; the host 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 { ] } Key::Char(' ') => self.spin(), - Key::Char('+') => { + Key::Char('+') | Key::Char('=') => { let _ = self.game.adjust_bet(10); self.board_effects() } 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 { \n\ Controls:\n\ SPACE - Spin the reels\n\ - +/- - Adjust total bet\n\ + + or = - Increase total bet\n\ + - - Decrease total bet\n\ Q - Exit the game" .to_string() } 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 @@ -171,6 +171,17 @@ fn spin_replaces_the_board_and_keeps_the_controls_line() { assert_eq!(h.screen.lines.len(), lines_before_spin); } +#[test] +fn equals_increases_the_bet_like_plus() { + let mut h = Harness::new(); + h.enter_slots("10"); + + h.key(Key::Char('=')); + + assert_eq!(h.board().len(), 10); + assert!(h.board()[1].contains("Bet: 20 PLN")); +} + #[test] fn changing_the_bet_after_a_spin_does_not_leave_stale_lines() { let mut h = Harness::new(); -- cgit v1.2.3