Random slides solve the easy boards and strand you on the hard ones. The engine holds a fixed definition of which car blocks which, and it grades every slide you make. This article turns that code into an unblock order that applies to all 25 levels.
How the engine counts a move
One slide equals one move, whatever the distance. The counter in startMoveWithAnimation increments once per accepted slide, so dragging a car five cells costs the same as dragging it one cell. The final exit slide also counts.
Undo pops the last move and decrements the counter, so a caught mistake is free for star purposes. Restart resets the counter to zero.
Stars come from calcStars. At or under par you earn 3 stars. At par plus 4 or better you earn 2. Anything slower earns 1. Par values live inside the level data: level 1 is par 2 with a single vertical blocker, level 22 is par 22, level 23 is par 24, level 24 is par 25, and the level 25 boss board measures 8 by 8 with 20 cars at par 28.
The unblock order the engine checks
Horizontal cars slide only left and right. Vertical cars slide only up and down. canMoveCar returns zero for any other direction, so each car's orientation fixes its escape axis.
Only the red player car may leave the grid. wouldExit grants the exit move when three conditions hold: the car is the player car, its row matches the exit position for a side exit or its column matches for a top or bottom exit, and the slide direction points at that side. Every exit in the shipped levels is one cell wide.
findBlockingCars defines the blocking relationship. For a right side exit it walks the player row from the front of the red car to the right wall and records every car it meets, nearest first. That scan is the unblock order. The first car in front of you blocks you first, and each car behind it waits its turn.
Two facts follow from the level data. Every blocker ahead of the red car in its exit row is vertical in all 25 levels, because a horizontal car in the exit row could never clear the lane. And a vertical blocker stops blocking you the moment its body no longer crosses the exit row, so sliding it the minimum clearance distance is enough.
Step by step solving routine
1. Locate the exit side and the red car. Confirm the exit row before touching anything.
2. Walk the exit row from the front of the red car to the wall. List each vertical car you meet, nearest first.
3. Take the nearest blocker. Slide it up or down the minimum number of cells that lifts its body clear of the exit row. Choose the side with more free cells so the next blocker keeps room.
4. If the nearest blocker cannot move up or down, find the car pinning it and clear that car first, then return to the blocker. The pin is always a car sitting on the cells the blocker needs.
5. Repeat until the exit row is clear, then slide the red car out in one move.
6. Count slides as you go and compare against par before the exit slide, because that slide also counts.
What the hint system actually tells you
You get 3 hints per level, and each hint highlights one car for 3 seconds. computeHint applies a fixed priority.
1. If the red car can already slide toward the exit, the hint highlights the red car. The lane is open, so exit.
2. Otherwise it highlights the first blocker in the scan order that can move at all, in the first direction with room.
3. If every blocker in the lane is pinned, the hint finds nothing and spends none of your budget.
The hint never looks past one level of dependency. It will not tell you which car pins a stuck blocker, and it will not warn you when freeing one blocker pins another. Restarting a level restores the hint budget of 3 along with your move count.
Where this implementation hurts you
Input locks during the slide animation, which runs at 16 cells per second. A five cell slide blocks the next tap for about a third of a second, and taps during the animation are dropped silently. Undo is also refused until the animation ends.
The hint is one move deep. On the level 25 boss board with 20 cars, expect chains where the highlighted car frees nothing until a second car moves first.
Undo does not restore hints, and restarting to recover hints erases your board progress. The star thresholds leave only 4 spare moves above par for 2 stars, so exploratory sliding on pars above 20 gets expensive fast.
Parking Jam pre-move checklist
- [ ] Exit side and exit row identified.
- [ ] Exit row walked, blockers listed nearest first.
- [ ] Slide side chosen for each blocker with confirmed free cells.
- [ ] Pinned blockers resolved before lane blockers.
- [ ] Move count compared against par before the exit slide.
Play the [Parking Jam game](/en/parking-jam) and test the unblock order on level 22 or above, where the chains get long. If the nearest-first order ever fails on a specific board, send the level number and your slide sequence. Boards where the scan order misleads are the most useful data you can contribute.