Define what “in order” means
The official DLC description announces colorful mushroom sorting. It does not establish the final color ranking, comparison command or legal rearrangement. Here, four numeric tokens stand in for values purely to teach the reasoning.
Our rule is left ≤ right for every adjacent pair. Start with [4, 1, 3, 2]. Compare the first two tokens, swap if the left is larger, then move one pair to the right. Each pass checks all three pairs, including pairs that may already be correct.
This is a deliberately fixed teaching scan. It is not the fastest sorting method, a DLC mushroom solution or a tick benchmark.
The starting order. Without JavaScript, the comparison table in the next section lists all nine comparisons.
Follow all three passes
| Pass | Pair | Decision | State afterward |
|---|---|---|---|
| 1 | 4, 1 | Swap | [1, 4, 3, 2] |
| 1 | 4, 3 | Swap | [1, 3, 4, 2] |
| 1 | 4, 2 | Swap | [1, 3, 2, 4] |
| 2 | 1, 3 | Keep | [1, 3, 2, 4] |
| 2 | 3, 2 | Swap | [1, 2, 3, 4] |
| 2 | 3, 4 | Keep | [1, 2, 3, 4] |
| 3 | 1, 2 | Keep | [1, 2, 3, 4] |
| 3 | 2, 3 | Keep | [1, 2, 3, 4] |
| 3 | 3, 4 | Keep; end pass | [1, 2, 3, 4] — stop |
There are nine comparisons and four swaps over three full passes. The array is already ordered after pass 2, but this particular stopping rule needs pass 3 to observe no swaps.
Without the controls, read the rows in order and cover the final column before predicting each result.
Take the reasoning one hint at a time
Hint 1: Why is one pass insufficient?
After the first pass, 4 is at the right end, but 3 still sits before 2. Moving one large value into place does not settle all earlier pairs.
Hint 2: What must reset at the start of a pass?
The pass’s “changed” flag. Begin each pass with no swaps recorded, then mark it when any swap happens. A flag left over from an earlier pass can prevent a correct stop.
Hint 3: What proves this example is done?
One complete pass checks every adjacent pair and makes zero swaps. Under the numeric ordering rule, each token is then no larger than the next.
Before applying the idea to mushrooms
Check the actual puzzle’s order, which items may be compared, and which moves are legal. If the game uses a two-dimensional relation, a row-only numeric scan may be insufficient. If a swap changes more than two cells, the trace must account for that state change.
For equal numeric values, our rule leaves them in place. An empty or one-item numeric sequence is already ordered, but that statement does not establish whether a DLC board can have those shapes.
Keep comparison, action and completion separate. A comparison can say two values are out of order without proving the requested swap succeeded. The state guide explains why an attempted action should not be recorded as a completed one.