Back to articles
I turned a 2014 puzzle game into a Python one-liner challenge

I turned a 2014 puzzle game into a Python one-liner challenge

via Dev.toFooks Michael

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

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles