The easiest way to make solvable puzzle levels every time is to turn the problem around: create one real solution first, then build the level around it. If every goal sits on a path the player can actually reproduce, the level can be beaten by construction, and you never need an expensive “is this possible?” search.
A small free browser game called Carom Shot shows the idea in one HTML file of about 250 lines of plain JavaScript. Below you will see how it works, why the “fun filters” matter as much as the math, and what players can learn from it to clear more levels.
| Quick facts | |
|---|---|
| Game | Carom Shot, a bank-shot puzzle: aim one ball, let it ricochet, hit every target |
| Price / platform | Free, plays in any modern browser on phone or computer |
| Tech | Vanilla JavaScript, one HTML file, no libraries |
| Rule | Hit all targets within 3 shots (2 shots from level 12); hits stay hit between shots |
| Bonus | Clear everything in one shot for a “Perfect!” |
| Generator | 500 levels in about 85 ms, all 500 solvable (developer’s figures, confirmed in our own rerun) |
| Play | Carom Shot official page |
The classic problem with random levels
Procedural levels save a solo developer weeks of design work, but they have one well-known failure: the generator happily produces a board that cannot be solved. In a bank-shot game the risk is obvious. Throw random blocks and random targets on a field, and some targets will sit where no bounce can ever reach them.
There are two common fixes:
- Generate, then check. Make a random level, run a solver, throw it away if the solver fails. Simple, but the solver can be slow, and for aiming games you would need to test thousands of angles per level.
- Generate the solution first. Make one valid play, then place the goals only where that play goes. The level is solvable before the player ever sees it.
Carom Shot uses the second approach. In its menu the game explains the whole rule set in four lines: drag to aim, release to shoot, bank off walls and blocks, hit every target in 3 shots.

How “solution first” works in Carom Shot
The generator follows a short recipe for each level:
- Place random blocks on the field (none on level 1, up to 5 later).
- Fire one random upward shot and simulate it until it runs out of bounces.
- Drop targets on points the ball really passed, mostly after the first bounce, spaced at least a little apart and never inside a block.
- Reject levels that are no fun (more on that below) and try again, up to 400 times.
- Keep the winning angle as the level’s stored solution.
Because every target is a point on a real path, the stored angle solves the level. The difficulty grows with the level number: the bounce budget starts at 2 and rises to a cap of 6, and the number of targets rises from 2 to a cap of 5.

One simulation for everything
The most important rule is easy to miss: the generator, the dotted aim preview and the real shot all call the same simulation function. If the generator found a path, the player can repeat it exactly.
The simulation also moves the ball in fixed steps of 3 units instead of using frame time. That way a 30 fps phone and a 144 Hz monitor produce the identical path. If you use a physics engine with variable time steps, this guarantee breaks, and a level that was solvable in the generator may miss by a pixel on a player’s device.
Fun filters: solvable is not the same as good
A level that is solvable can still be boring. Carom Shot throws away a generated level when:
- The shot bounced too few times. A level that needs no banking is not a bank-shot puzzle.
- All targets sit on one straight segment. Early versions often put four targets in a line, which reads as “just aim there”. Now targets must spread over at least two or three different bounce segments.
- A straight shot already clears it. The same angle with zero bounces is tested; if it hits everything, the level is rejected.
These checks cost almost nothing. The developer reports 500 generated levels (levels 1 to 25) in about 85 ms with 500 of 500 verified as solvable. We ran the game’s own generator code in Node.js and got the same result: 500 levels in 84 ms, and the stored angle cleared every one.
Measure difficulty instead of guessing
Solvable is also not the same as fair. The developer swept 3,000 aim angles per level and measured two “windows”: how wide the range of angles is that clears everything in one shot, and how wide it is for the hardest single target.
| Level | One-shot window (median) | Hardest single target (median) |
|---|---|---|
| 1 | 7.5° | 29° |
| 5 | 2.9° | 25° |
| 8 | 2.1° | 21° |
| 20 | 2.1° | 24° |

Two design decisions came straight from those numbers:
- One-shot clears became a bonus. About 2° of precision is hard on a touchscreen, so “Perfect!” is a reward, not the rule. The rule is three shots, and targets you hit stay hit.
- Late levels get fewer shots instead of tighter angles. Single-target windows stay forgiving (roughly 20–35°), so from level 12 the game gives 2 shots instead of 3.
The same idea in famous puzzle generators
Carom Shot is tiny, but the principle has a long history:
| Puzzle | How the generator guarantees a solution |
|---|---|
| Sokoban | Researchers Joshua Taylor and Ian Parberry (2011) place the goals first, then search backwards by pulling boxes; any state reached in reverse can be solved forwards |
| Minesweeper (Simon Tatham’s Mines) | The grid is built after your first click, and a built-in solver that thinks like a human checks it; mines are moved until no guessing is needed |
| Rush Hour | Michael Fogleman enumerated every “interesting” starting position in 2018; the most common puzzle needs 11 moves, and very hard ones are rare |
| Carom Shot | One real shot is simulated first, and targets are placed on its path |
You can read the Sokoban generator paper page, Simon Tatham’s write-up on soluble Mines grids and Michael Fogleman’s Rush Hour database article for the details.
Tips for players: clear more bank-shot levels
The way a level is built tells you how to beat it:
- Every target lies on one real path. If two targets look far apart, think “which wall connects them?” rather than “which two shots do I need?”.
- Start from the first bounce. Targets are mostly placed after the first bounce, so look for the wall the path must hit first.
- Use the early preview. On levels 1–3 the dotted line shows two segments; later it shows only the first, so you read the rest yourself. Angle in equals angle out.
- Bank on shots, not on Perfect. Hits stay hit, so a safe first shot that takes two or three targets is a good plan.
- Use the keyboard on desktop. Arrow keys aim, Shift plus an arrow makes tiny adjustments, Space or Enter shoots.
- Watch the bounce counter. The number under the field is the bounce budget; when it runs out, the shot ends.
Lessons for web game developers
If you build puzzle games for the browser, these points carry over to almost any genre:
- Share one deterministic simulation between the generator, any preview and real play.
- Use fixed steps or a fixed timestep, never raw frame time, for anything a level depends on.
- Store the solution with the level. It doubles as a hint system and a regression test.
- Add cheap rejection rules for boredom, not just for correctness.
- Measure difficulty (angle windows, move counts, solver steps) and decide rules from data.
- Give generators a fallback, as Carom Shot does by retrying with the previous level’s settings.
The developer also notes that the game, its code and the write-up were made by an AI agent working with a human partner, and asks players for feedback on where the difficulty feels off.
Play a similar game on VENO
If you like aiming a shot and letting the bounces do the work, try VENO Rimly: you launch gummies inside a rainbow jelly ring, every bounce chips the ring’s HP, and slipping out through the gap pays 12 times your Sweets in coins.

FAQ
How do you make sure a puzzle level is solvable?
Either run a solver on each generated level and discard failures, or generate a valid solution first and build the level around it. The second way guarantees a solution without any search.
Is a solvable level always a fair level?
No. A level can need a 2° perfect aim. Measure how wide the winning window is and add rules, such as extra shots, so the level feels fair.
Why should the preview and the generator share code?
If they use different physics, a path the generator found may not work for the player. One shared, deterministic simulation keeps them identical.
Does frame rate change the ball path?
In Carom Shot it does not, because the ball moves in fixed steps rather than by frame time. Games that use frame time can produce different paths on different devices.
Is Carom Shot free?
Yes. It is a free browser game with no sign-up, and your best level is saved in your browser.



