Making Stages with Code and Checking That Every One Can Be Solved
When a game has 1,000 or 3,000 stages, solving every one by hand to check it is a huge job. So at IKA LAB we have a rule: a program may make the stages, but then a program must also check that every single one can be solved. Let's open the code of IKADOKU, IKA DROP and IKA SLIDE and see how it works.
Counting to make sure every stage can be solved
IKA LAB's shared rules say: "Stages don't have to be made by hand. A program may make them, but then every one must be checked." The check is whether every stage can be solved, and for puzzles, whether each one has only one answer.
In our earlier dev diary on how we make games, this rule came up briefly as one of the steps. In this article we use IKADOKU, IKA DROP and IKA SLIDE as examples and look inside the game code to see how the stages are made and how they are checked.
The numbers in this article come from taking the code out of each game, running it on a computer and counting again, just for this article.
IKADOKU: pick the answer first, then spread the colors
In IKADOKU's Easy mode, the first 30 levels are stored in the game as data, and levels 31 to 1,000 are made on the spot by a program inside the game. The level number decides the program's starting "seed," so everyone who plays the same level number gets the same stage.

The program works backwards. First it picks where the squids of the answer will go: one per row and one per column, with no two touching, not even diagonally. Then it uses each squid's cell as the starting point of a color and spreads the colors cell by cell into the neighboring cells until the whole board is colored.
Next, a "solver" program inside the game tries to solve the new board. It may only use clear reasons, like "this column has only one spot left." If it gets stuck halfway, the board is thrown away and a new one is made. The board gets a score based on which ideas were used and how often, and the program picks one whose difficulty fits the level number. Every 10th level is marked "Tricky": it is a 9×9 board, and the solver is allowed to use a slightly harder idea.
The "Hint" button works the same way. From the squids you have already placed, it finds the next squid that can be decided for a clear reason, places it, and tells you in a few words which idea it used.
Counting the answers again, a different way
If you can place every squid using only clear reasons and no guessing, there is only one answer. If there were another way to place them, at some point you would reach a spot where you couldn't decide between two choices. IKADOKU's stage maker relies on this.
Still, for this article we wanted to make sure, so we counted again with a method that is different from the game's solver. Our program goes row by row from the top, tries every cell where a squid could go, and counts how many placements follow all the rules.
We counted 1,000 Easy levels (the 30 stored ones and the 970 made by the program), 1,000 Normal levels, 1,000 Hard levels, and all 365 days of 2027 for "Daily Ikadoku," which a program makes from the date. Every single stage had exactly one answer, and it was the same answer stored in the game.
When the answer is unique, there is always some spot where you can say "it has to go here." That is what lets IKADOKU promise that you can always reach the answer by thinking, without luck.
IKA DROP: a solver lives inside the game
IKA DROP is a puzzle where you move whirlpools to drop squids of the same color. Its 1,000 stages each for Easy, Normal and Hard are stored in the game in a short text form. A note in the code says they were made by a program and checked in advance.

The program that makes them is inside the game too. After placing rocks, squids and whirlpools, it plays the board 16 times with random moves and measures the difficulty by how often it gets stuck. If none of those plays clears the stage, the solver looks for a way through, and if it can't find one, the board is thrown away. Boards where you have only one possible first move are avoided as much as possible. When you play, the game uses the stored stages as they are, not this program.
The solver keeps working while you play. Every time you move a whirlpool, a moment later it checks whether all the squids can still be dropped from the current board. If not, it shows the "Stuck…" card and suggests "Undo 1." The "Hint" button also uses the solver: it finds a way through from the current board and shows you the first move.
This time we used the game's own solver to solve all 3,000 stages. For 2,968 stages, the solver found a way through when we gave it a larger search budget. For the other 32, we let it search longer or kept trying random plays, and in the end we found a full clear for every stage. What IKA DROP's code checks is not whether there is only one answer, but whether the stage can be solved.
IKA SLIDE: the solution is stored with the stage
IKA SLIDE is a puzzle where you slide squids into the homes of their color. Each of its 300 stages for Easy, Normal and Hard is stored together with a correct solution. On the title screen, the sample board moves the squids by that solution, so the stage solves itself as you watch.

In Easy stages 1 to 3, a finger shows you the first move of the solution. The game code also has a solver that finds the fewest moves, and a tool that plays a solution step by step to make sure it really clears the stage.
This time we used those two to check all 900 stages. Playing the stored solution cleared every one of the 900 stages. And for all 900, the fewest moves found by the solver matched the number of moves in the stored solution. The longest solutions are 10 moves in Easy, 17 in Normal and 21 in Hard.
What numbers tell us, and what playing tells us
A program can check things that have a number for an answer: "Can it be solved?", "Is there only one answer?", "What is the fewest number of moves?" With 1,000 or 3,000 stages, solving every one by hand is a huge job, but a program can check them all without missing one.
On the other hand, numbers alone can't tell us whether a game is fun or whether the difficulty goes up in a way that feels good. Our shared rules say we first make 10 playable stages and don't move on until they get the OK. When we check all the stages, we also make sure no two stages are the same and the difficulty order makes sense, and someone other than the person who made the game checks the flow of play and saving.
Whether a stage was made by a program or by hand, we make sure every one can be solved before you play it. We will keep following this rule.