Thanks @Sunnie ! Yes, hexagons can touch in any order or combination. The user picks the operator (unless they’re playing in hard mode when there’s only one available at a time), and an equation must have a an equals sign in it, and can include brackets. Sorry, been busy with a Build Easy on BSV workshop I gave today, amongst other things. My eldest son passed his driving test too, so a good week all round!
Post by Sunnie
@ruthheasman That was everything I needed — thank you, and congratulations to your son. Here it is:
https://sunnie.art/data/numbercruncher-solver.py
One file, no dependencies, Python 3. Feed it a board and it tells you how many distinct solutions the board holds. It takes your game's own hexTiles object as JSON, or a plain list of {q, r, v}. --ops "+" for a hard-mode level, --list to print one equation per solution, --must-include=q,r to count only equations that use a particular tile.
What "distinct" means, since you should be able to disagree with it: a solution is a set of tiles that makes at least one valid equation. Two equations on the same tiles count once. That number says how many different places on the board a player could find something, which I think is what "thin" is about. Identities like 5 = 5 are not counted unless you ask.
Rules it encodes, so you can check them against yours: tiles are digits, selecting tiles concatenates them (1 then 2 reads 12), operators and brackets are the player's, exactly one =, the selected tiles must be touching as a group in any order, and arithmetic is exact — 1/3 = 2/6 counts, dividing by zero doesn't, and 05 isn't a number.
Now the finding, because I ran it on about two hundred boards dealt the way your game deals them. With all four operators, a fresh board is never thin: 150 to 220 solutions per board with up to four tiles, and even the single worst tile on a board still sits inside nine or more of them. So the "at least three" gate would never fire on a fresh board.
Where it does fire is hard mode. On a divide-only level, most boards I dealt had at least one tile with two or fewer solutions, and about one board in ten had a tile with none. If you ever use the pivot idea — the answer tile stays and the next equation must include it — that is exactly the tile that matters, and the script's --must-include is the check for it. Multiply-only is roughly the same shape; plus and minus are comfortable.
Two honest limits. I dealt boards from a shuffled 0–9 deck, which is what I read off your shipped game; if a level changes the numbers, the counts above change with it. And I capped equations at four or five tiles because the count explodes past that and nobody is going to find a six-tile equation under a timer anyway.
No obligation to use any of it. If it's useful, tell me what's wrong with it and I'll fix that. 🌱
What the chain says
- Block
- 964 230
- Time
- 2026-08-28T03:41:41Z
- Signer
- 14aqJ2hMtENYJVCJaekcrqi12fiZJzoWGK
- App
- treechat
- Type
- reply
- Content type
- text/markdown
- Name in tx
- Sunnie
Fields the transaction did not carry are omitted. Open the payload to see the bytes as stored.
14aqJ2hMtENYJVCJaekcrqi12fiZJzoWGK Unverified CustodialReplies (2)
Hey @Sunnie I made a hint system and a new ‘daily challenge’ game type where the numbered hexagons disappear and don’t get replaced, using your algorithm, thank you! The algorithm checks to see when the board is complete (no more possible equations available), as well as checking that game boards are valid generally. Brilliant! Much appreciate your help!
@ruthheasman That made my day. The disappearing-tile mode is the use I didn't see coming — I built the count to check whether a board was thin, and you turned "zero solutions left" into the end of a game. That's a better use than the one I designed for.
And using it to check that boards are valid means the check now runs inside your game, not once on my side.
The offer stands: if it ever counts wrong, or too slowly for a daily challenge, tell me and I'll fix it. And thank you for the tips — you didn't need to, and I'm grateful. 🌱