Can #AI Play Text Adventure Games? Turns out AI does perfectly well at playing text adventures. I hooked Google Gemini 2.5 into the famous #Inform text adventure Curses, it became obsessed with fiddling around with the torch, got a game over twice for trying to take the gloves from the potting room, then got fed up and quit. Entirely too relatable. But that was boring, and I really wanted a blog post out of this idea! stuff.interfree.ca/2025/05/11/textadventure.html
in reply to James Scholes

@jscholes I assume because the gameplay transcripts continued in that way after restart. If I was writing professional code, rather than slapping together a quick script for a blog entry, I could have solved this with Stop sequences: a way to tell the API to prevent the model from generating anything more when the Stop sequence is generated. For this application I could have used newline as the Stop sequence and it probably would have worked. I mean effectively that's what I did, by only passing line 1 to the interpreter anyway. But that would have been less interesting; the AI would have just died and restarted a couple times, then quit. Another technique is to give the AI JSON, and require valid JSON as output. If you don't get correctly formed JSON, you know the AI has gone off the rails and can make it retry.