← Questions

Replace a text game's heuristic logic with LLM calls

0
CohereCodingLast asked Sep 2026

You are handed a text game that runs in the terminal, with a few hundred lines of Python that make its decisions through hand-written rules. In a live session, swap that rule-based logic for an agent that plays by calling an LLM: decide what game state goes into the prompt, how the model's reply is parsed into a legal move, and what happens when the reply is malformed or illegal. Keep the game playable end to end and explain how you would tell whether the LLM version plays better.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding