From fc5872a5af00249dc6381648a4c3db9960d85319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Fri, 2 Jan 2026 15:03:54 +0100 Subject: [PATCH] don't allow moving towers of the same color to empty spots --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 73931af..6f7dae2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -280,6 +280,13 @@ impl Game { continue; } + let rings = self.towers[from_tower].rings; + if rings[1..].iter().all(|i| i == &rings[0]) + && self.towers[to_tower].rings[0].is_none() + { + continue; + } + let m = Move::new(from_tower, to_tower); if self.try_make_move(m, true).is_ok() { res.push(m);