Scripting Uncle Chop's Rocket Shop

Uncle Chop's Rocket Shop is a game about running a repair shop in a spaceship. Two of its minigames — the Pancake Mixer and the Security Cracker — involve repetitive combinatorial puzzles that get old fast once you understand the underlying logic. So I automated them.

Pancake Mixer

The Pancake Mixer presents you with a required set of pancake types and a stack of a given size. You need to construct a valid arrangement from the available ingredients. The catch: certain combinations are invalid, and the stack size constrains how many you can use.

The script generates all valid configurations up front, given the required pancakes and stack size as input. It's essentially a constrained permutation problem — enumerate permutations, filter against validity rules, present the options.

def generate_stacks(required, size):
    all_combos = itertools.permutations(required, size)
    return [stack for stack in all_combos if is_valid(stack)]

def is_valid(stack):
    # Adjacent pancakes can't be the same type
    return all(stack[i] != stack[i+1] for i in range(len(stack)-1))

The output lists every valid stack configuration, which you can then pick from based on what ingredients the game gives you.

Security Cracker

The Security Cracker is a different kind of puzzle. It presents a sequence of dice and a captcha pattern. You need to invert certain dice values and match the captcha sequence to unlock the panel.

The script takes the current dice values and the target sequence as input and computes the exact inversions needed. Dice inversion in this context means flipping a die to its opposite face — on a standard die, opposite faces sum to 7, so the inverse of 3 is 4, the inverse of 1 is 6, and so on.

def invert_die(value):
    return 7 - value

def solve_cracker(current_dice, target_sequence):
    steps = []
    for i, target in enumerate(target_sequence):
        current = current_dice[i]
        if current != target:
            steps.append(f"Die {i+1}: invert {current} → {invert_die(current)}")
    return steps

These aren't game-breaking cheats — they're tools that let you focus on the parts of the game that are actually fun. The minigames are fun once or twice. After the fiftieth time, having a script handle the math is just good sense.

What I actually learned

Beyond the specific puzzles, this project was a good excuse to work with itertools properly for the first time. The permutation and combination generators are remarkably useful once you're comfortable with them, and the filtering pattern (generate → validate → present) generalises to a surprising number of real problems.


← Back to all posts  ·  Pancake Mixer ↗  ·  Security Cracker ↗