In 2014, I made an inductive reasoning game for a Kivy contest — you figured out hidden rules about colored sequences by testing examples. Pure logic, no code involved. It was fun but rough.
Recently I realized the same mechanic works perfectly as a programming puzzle: instead of proving you know the rule by passing an exam, you write a Python one-liner that captures it. So I rebuilt it for the browser with both modes.
How it works
Each level has a secret rule. You see caterpillars (colored segments) — some are valid, some aren't. You build your own to test hypotheses: the caterpillar smiles if it matches the rule, frowns if it doesn't.
Caterpillar Logic — the original mode. When you think you've cracked it, take an exam: classify 15 caterpillars in a row. One mistake and you're back to exploring.
Caterpillar Code — write a Python boolean expression that captures the rule. You get three variables: c (color list), f (color frequencies), s (run-length segments). Shorter expressions earn more stars — so there's a code golf element.
20 built-in levels, plus user-created levels. The difficulty goes from "obvious after 3 examples" to "staring at the screen for 10 minutes."
Tech
Vanilla TypeScript, Canvas 2D for animations, Pyodide for client-side Python evaluation, Supabase for auth and community levels. No framework, everything runs in the browser.
Inspired by Zendo and Eleusis — inductive reasoning board games where you deduce rules from examples instead of being told them.
Try it
Free, no ads, no signup required: https://caterpillars.games
The 2014 original (Kivy/Python): https://github.com/gromozeka1980/kivy_contest_2014
Would love any feedback — design, gameplay, difficulty, anything that felt off or satisfying.
Top comments (0)