
I Let an LLM Play Cookie Clicker. Then I Fixed Its Biggest Weakness.
What a toy game taught me about when AI planning actually beats simple heuristics, and when it doesn't. Cookie Clicker is secretly a resource allocation problem. You have one currency (cookies), a growing menu of buildings that generate cookies per second (CpS), tiered upgrades that double building output, and costs that scale exponentially. Every tick, you face the same decision: what should I buy next? It feels like the kind of problem that rewards planning. Look ahead, sequence your purchases toward powerful upgrades, and you should come out ahead. So I built a simplified Cookie Clicker simulation in Python and asked: can an LLM make better spending decisions than a simple greedy algorithm? The answer is more interesting than "yes" or "no." The LLM identifies opportunities the greedy algorithm is structurally blind to, but it executes them inside a worse control loop. Fix the control loop, and the combination beats both. The Setup The simulation has 10 buildings (Cursor through Alch
Continue reading on Dev.to Python
Opens in a new tab



