Match mushroom types before pushing

Already at a mushroom layer? A November 7 community routine compares the current mushroom with a neighboring mushroom and checks whether it can push in that direction before trying to match them. Matching equal types is a different task from sorting numbers into ascending order.

On this page

Check one possible mushroom match

This applies after you have reached mushrooms and unlocked the operations you intend to use. Luzahe’s November 7, 2026 mining guide shows a matching routine using Grounds.Mushroom, measure(), measure(direction), can_push(direction) and push(direction). Its setup uses a 32-wide world and jump(Unlocks.Mushrooms); it is not a first-unlock walkthrough.

  1. Confirm the current ground is Grounds.Mushroom and read its measured type.
  2. For a candidate direction, check that pushing is allowed and that the neighboring ground is also a mushroom.
  3. Compare that neighbor’s measured type with the current type. In the author’s matching branch, equal values trigger the push attempt.
  4. Read the resulting state again before choosing another action. Keep an attempted push separate from a confirmed match.

The guide also compares Items.Mushroom inventory before and after work. A counter incremented merely because a push was attempted is not equivalent to that observed resource change.

A local match is not a complete stratum solution

A Steam reply marked as the developer describes Matchmaker as matching at least 95% of the mushrooms in a stratum, in pairs. One successful local match therefore does not establish that the achievement is complete. The reply’s example is inconsistent about layer count, so no fixed stratum size is assumed here.

The community routine also tries rearrangements when it cannot find a matching neighbor. This page does not establish all legal height changes, a reliable rearrangement strategy or a guaranteed 95% completion route. Pause and inspect the current in-game action documentation when a move is unavailable; do not replace a failed action with an invented success.

Source scope: the routine was published in November 2026 and checked on November 9. It supplies concrete author-used operations, not a numeric game-build identifier or our own execution result. This is a bounded action check, not a tested script, complete unlock route or full puzzle solver.

Separate practice: sort four numeric tokens

The exercise below teaches numeric ordering, not the mushroom matching rule above. Four numbers increase from left to right; equal numbers stay in place rather than being matched away. Its swaps do not simulate push(), terrain or mushroom layers.

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.

4132compare this pair first

The starting order. The table below retains all nine comparisons without JavaScript.

before
[4, 1, 3, 2]
action
No comparison yet; start with 4 and 1.
after
[4, 1, 3, 2]
check
A full pass checks all 3 adjacent pairs.
next
Pass 1, pair 0–1.

Conceptual pseudocode · fixed teaching trace

Read the highlighted line beside its state. This is not executable DLC code.

  1. start a full pass; changed ← false
  2. compare each adjacent pair left to right
  3. if left > right: swap; changed ← true
  4. finish all 3 comparisons in this pass
  5. stop only after a complete no-swap pass

Repeating the same pair? Inspect the first missing index update. Keep the whole-pass stop condition separate from a single ordered pair.

Follow all three passes

Every comparison in the original full-scan example
PassPairDecisionState afterward
14, 1Swap[1, 4, 3, 2]
14, 3Swap[1, 3, 4, 2]
14, 2Swap[1, 3, 2, 4]
21, 3Keep[1, 3, 2, 4]
23, 2Swap[1, 2, 3, 4]
23, 4Keep[1, 2, 3, 4]
31, 2Keep[1, 2, 3, 4]
32, 3Keep[1, 2, 3, 4]
33, 4Keep; 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.

Carry over state checks, not the numeric rule

The useful habit is to separate comparison, action and completion. A matching type suggests a candidate action; it does not prove the attempted push succeeded or the whole stratum is finished. Read the resulting world and resource state before recording progress.

The numeric exercise stops after a full pass with no swaps. Do not reuse that as a mushroom completion test: no local action can also mean a blocked arrangement. The state guide explains how to keep confirmed observations separate from pending work.

Sources and further reading