Summary: | Shuffling has the chance of generating a solved puzzle | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Jan Bidler <janbidler00> |
Component: | Fifteen Puzzle widget | Assignee: | Plasma Bugs List <plasma-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cwo.kde, nate |
Priority: | NOR | ||
Version First Reported In: | 6.3.5 | ||
Target Milestone: | 1.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kdeplasma-addons/-/commit/de00ace4af9f708401069f6bd2721fdfbbf1549c | Version Fixed In: | 6.4.0 |
Sentry Crash Report: |
Description
Jan Bidler
2025-05-28 15:59:36 UTC
Can reproduce, but a 2x2 puzzle isn't much of a puzzle! I wonder if 3x3 should be the minimum size. (In reply to Nate Graham from comment #1) > Can reproduce, but a 2x2 puzzle isn't much of a puzzle! I wonder if 3x3 > should be the minimum size. 2×2 is good for testing, and I guess if someone wants a truly easy win. I'd say it's fine to keep it as the minimum, users who want at least a small challenge can simply choose a higher number.. A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/830 Git commit 1ed2c7ff69154e06cc890bf94c59bbcf40b34fa6 by Christoph Wolk. Committed on 29/05/2025 at 09:08. Pushed by cwo into branch 'master'. applets/fifteenpuzzle: don't shuffle into a solved puzzle When reshuffling the board, it's possible to immediately get an already solved puzzle. It's very unlikely for realistic board sizes, but can be triggered somewhat if you refresh a 2×2 board often for some reason. We might as well make sure it never happens. To do this easily, we convert the existing solution checker into a function with return value, rather than always immediately marking the board as solved if it is, and use that to reshuffle if needed. M +9 -4 applets/fifteenPuzzle/package/contents/ui/FifteenPuzzle.qml https://invent.kde.org/plasma/kdeplasma-addons/-/commit/1ed2c7ff69154e06cc890bf94c59bbcf40b34fa6 Git commit de00ace4af9f708401069f6bd2721fdfbbf1549c by Christoph Wolk. Committed on 29/05/2025 at 19:17. Pushed by cwo into branch 'Plasma/6.4'. applets/fifteenpuzzle: don't shuffle into a solved puzzle When reshuffling the board, it's possible to immediately get an already solved puzzle. It's very unlikely for realistic board sizes, but can be triggered somewhat if you refresh a 2×2 board often for some reason. We might as well make sure it never happens. To do this easily, we convert the existing solution checker into a function with return value, rather than always immediately marking the board as solved if it is, and use that to reshuffle if needed. (cherry picked from commit 1ed2c7ff69154e06cc890bf94c59bbcf40b34fa6) Co-authored-by: Christoph Wolk <cwo.kde@posteo.net> M +9 -4 applets/fifteenPuzzle/package/contents/ui/FifteenPuzzle.qml https://invent.kde.org/plasma/kdeplasma-addons/-/commit/de00ace4af9f708401069f6bd2721fdfbbf1549c |