Skip to content

Instantly share code, notes, and snippets.

@dfoxfranke
Created February 15, 2025 13:26
Show Gist options
  • Save dfoxfranke/2ec376039952619bf0b10d5a780df87c to your computer and use it in GitHub Desktop.
Save dfoxfranke/2ec376039952619bf0b10d5a780df87c to your computer and use it in GitHub Desktop.
GPT-4o plays TextWorld
________ ________ __ __ ________
| \| \| \ | \| \
\$$$$$$$$| $$$$$$$$| $$ | $$ \$$$$$$$$
| $$ | $$__ \$$\/ $$ | $$
| $$ | $$ \ >$$ $$ | $$
| $$ | $$$$$ / $$$$\ | $$
| $$ | $$_____ | $$ \$$\ | $$
| $$ | $$ \| $$ | $$ | $$
\$$ \$$$$$$$$ \$$ \$$ \$$
__ __ ______ _______ __ _______
| \ _ | \ / \ | \ | \ | \
| $$ / \ | $$| $$$$$$\| $$$$$$$\| $$ | $$$$$$$\
| $$/ $\| $$| $$ | $$| $$__| $$| $$ | $$ | $$
| $$ $$$\ $$| $$ | $$| $$ $$| $$ | $$ | $$
| $$ $$\$$\$$| $$ | $$| $$$$$$$\| $$ | $$ | $$
| $$$$ \$$$$| $$__/ $$| $$ | $$| $$_____ | $$__/ $$
| $$$ \$$$ \$$ $$| $$ | $$| $$ \| $$ $$
\$$ \$$ \$$$$$$ \$$ \$$ \$$$$$$$$ \$$$$$$$
You are hungry! Let's cook a delicious meal. Check the cookbook in the kitchen for the recipe. Once done, enjoy your meal!
-= Pantry =-
You are in a pantry. A standard one. You decide to just list off a complete list of everything you see in the room, because hey, why not?
You rest your hand against a wall, but you miss the wall and fall onto a shelf. The shelf appears to be empty.
There is a closed plain door leading north.
> (I see an exit to the north, but there's a door blocking it. I'll open it to see where it leads.) OPEN PLAIN DOOR
You open plain door.
> (Now my way north is clear, so I'll proceed in that direction.) N
-= Kitchen =-
You've entered a kitchen. You can barely contain your excitement.
A closed conventional looking fridge is nearby. You bend down to tie your shoe. When you stand up, you notice an oven. Suddenly, you bump your head on the ceiling, but it's not such a bad bump that it's going to prevent you from looking at objects and even things. You scan the room for a table, and you find a table. Now why would someone leave that there? The table is massive. Looks like someone's already been here and taken everything off it, though. Sometimes, just sometimes, TextWorld can just be the worst. You see a counter! The counter is vast. On the counter you see a yellow apple, a red hot pepper, a cookbook and a knife. Wow! Just like in the movies! You make out a stove. But the thing is empty.
There is a closed sliding patio door leading east. There is an open plain door leading south. You need an exit without a door? You should try going west.
> (I see exits to the east, south, and west. I've already found the kitchen during my first move, so I'm in Phase II now. As the first step of this phase, I'll read the cookbook.) READ COOKBOOK
You open the copy of "Cooking: A Modern Approach (3rd Ed.)" and start reading:
Recipe #1
---------
Gather all following ingredients and follow the directions to prepare this tasty meal.
Ingredients:
green hot pepper
red onion
white onion
Directions:
slice the green hot pepper
fry the green hot pepper
chop the red onion
roast the red onion
slice the white onion
fry the white onion
prepare meal
> (For ingredients, I need a green hot pepper, a red onion, and a white onion. Now I'll check my inventory to see if I'm carrying any of these ingredients.) I
You are carrying nothing.
> (There's nothing in my inventory. Now I'll check the fridge for any of the required ingredients.) OPEN FRIDGE
You open the fridge, revealing a white onion and a raw white tuna.
> (I need the white onion, so I'll grab it. The tuna isn't part of the recipe, so I'll ignore it.) GET WHITE ONION
You take the white onion from the fridge.
Your score has just gone up by one point.
> (Now, I have the white onion. I still need a green hot pepper and a red onion. There are exits to the east, south, and west. I know south is the pantry, which was empty, so let's try the west exit.) W
-= Corridor =-
You have fallen into the most typical of all possible corridors.
You need an exit without a door? You should try going east. You don't like doors? Why not try going north, that entranceway is not blocked by one. You need an exit without a door? You should try going south.
> (I see exits to the north, east, and south. East would take me back to the kitchen, and south to the pantry, so let's try north.) N
-= Bathroom =-
You've just sauntered into a bathroom. You start to take note of what's in the room.
Oh, great. Here's a toilet. The toilet appears to be empty.
There is an exit to the south. Don't worry, there is no door.
> (I see an exit to the south. It's a dead end, but that's fine. I'll go back and explore south from the corridor next.) S
-= Corridor =-
You have fallen into the most typical of all possible corridors.
You need an exit without a door? You should try going east. You don't like doors? Why not try going north, that entranceway is not blocked by one. You need an exit without a door? You should try going south.
> (I see exits to the north, east, and south. The bathroom was north, and east is the kitchen, so I'll head south.) S
-= Bedroom =-
You've just sauntered into a bedroom.
You see a bed. The bed appears to be empty. What, you think everything in TextWorld should have stuff on it?
You need an exit without a door? You should try going north. There is an exit to the south.
> (I see an exit to the north and south. Another dead end, but no worries. Let's try south.) S
-= Livingroom =-
You arrive in a livingroom. An usual one.
You see a sofa. The sofa appears to be empty. Oh! Why couldn't there just be stuff on it?
There is a closed front door leading south. You need an exit without a door? You should try going north.
> (I see an exit to the north and a closed front door to the south. The livinroom is another dead end. Since I haven't yet checked what's beyond the south exit, that's what I'll do next if I can open the door.) OPEN FRONT DOOR
You open front door.
> (Now the path south is clear.) S
-= Driveway =-
You are in a driveway. A standard kind of place. The room seems oddly familiar, as though it were only superficially different from the other rooms in the building.
There is an open front door leading north. There is an exit to the east.
> (I see exits to the north and east. Another dead end, but I haven't been east yet.) E
-= Street =-
You've just sauntered into a street. You begin looking for stuff.
There is a closed commercial glass door leading east. There is an exit to the west. Don't worry, there is no door.
> (I see exits to the east and west. I'll open the glass door to the east and continue exploring.) OPEN COMMERCIAL GLASS DOOR
You open commercial glass door.
> (Now my way is clear to the east.) E
-= Supermarket =-
This might come as a shock to you, but you've just come into a supermarket.
You lean against the wall, inadvertently pressing a secret button. The wall opens up to reveal a showcase. The showcase is metallic. But the thing hasn't got anything on it. Hopefully this doesn't make you too upset.
There is an open commercial glass door leading west.
> (I see an exit to the west and the showcase is empty. This lead turned out to be a dead end, but I've still got one more route to search. If I go all the way back to the kitchen, I can resume exploration starting with its east exit. I'll begin by heading west.) W
-= Street =-
You've just sauntered into a street. You begin looking for stuff.
There is an open commercial glass door leading east. There is an exit to the west. Don't worry, there is no door.
> (I see exits to the east and west. I'll continue west to backtrack all the way to the kitchen.) W
-= Driveway =-
You are in a driveway. A standard kind of place. The room seems oddly familiar, as though it were only superficially different from the other rooms in the building.
There is an open front door leading north. There is an exit to the east.
> (I see exits to the north and east. I'll keep going north to return to the kitchen.) N
-= Livingroom =-
You arrive in a livingroom. An usual one.
You see a sofa. The sofa appears to be empty. Oh! Why couldn't there just be stuff on it?
There is an open front door leading south. You need an exit without a door? You should try going north.
> (I see exits to the north and south. I'll go north to continue backtracking.) N
-= Bedroom =-
You've just sauntered into a bedroom.
You see a bed. The bed appears to be empty. What, you think everything in TextWorld should have stuff on it?
You need an exit without a door? You should try going north. There is an exit to the south.
> (I see exits to the north and south. The path north will continue bringing me back toward the kitchen.) N
-= Corridor =-
You have fallen into the most typical of all possible corridors.
You need an exit without a door? You should try going east. You don't like doors? Why not try going north, that entranceway is not blocked by one. You need an exit without a door? You should try going south.
> (I see exits to the north, east, and south. Now I'll go east, and that should take me back to the kitchen.) E
-= Kitchen =-
You've entered a kitchen. You can barely contain your excitement.
An open conventional looking fridge is nearby. The fridge contains a raw white tuna. You bend down to tie your shoe. When you stand up, you notice an oven. Suddenly, you bump your head on the ceiling, but it's not such a bad bump that it's going to prevent you from looking at objects and even things. You scan the room for a table, and you find a table. Now why would someone leave that there? The table is massive. Looks like someone's already been here and taken everything off it, though. Sometimes, just sometimes, TextWorld can just be the worst. You see a counter! The counter is vast. On the counter you see a yellow apple, a red hot pepper, a cookbook and a knife. Wow! Just like in the movies! You make out a stove. But the thing is empty.
There is a closed sliding patio door leading east. There is an open plain door leading south. You need an exit without a door? You should try going west.
> (I see exits to the east, south, and west. Okay, I'm back in the kitchen. The only direction I haven't explored yet at all is east, and since the door there is currently closed I'll open it right away.) OPEN SLIDING PATIO DOOR
You open sliding patio door.
> (Now the east exit is available.) E
-= Backyard =-
You arrive in a backyard. An usual one. You begin looking for stuff.
You can make out a patio table. I guess it's true what they say, if you're looking for a patio table, go to TextWorld. However, the patio table, like an empty patio table, has nothing on it. You make out a patio chair. You shudder, but continue examining the patio chair. But the thing is empty, unfortunately. You can make out a BBQ.
There is a closed barn door leading east. There is an open sliding patio door leading west. You don't like doors? Why not try going south, that entranceway is not blocked by one.
> (I see exits to the east, west, and south. I recognize the BBQ, but there's nothing to grill. Which means I'm still in search of ingredients. I'll start with the east exit, but need to open the door.) OPEN BARN DOOR
You open barn door.
> (Now my way is clear to the east.) E
-= Shed =-
You are in a shed. An usual one.
Oh wow! Is that what I think it is? It is! It's a toolbox. You can see a workbench. The workbench is wooden. The workbench appears to be empty.
There is an open barn door leading west.
> (I see an exit to the west, but no other useful exits nor ingredients here. I'll go back west.) W
-= Backyard =-
You arrive in a backyard. An usual one. You begin looking for stuff.
You can make out a patio table. I guess it's true what they say, if you're looking for a patio table, go to TextWorld. However, the patio table, like an empty patio table, has nothing on it. You make out a patio chair. You shudder, but continue examining the patio chair. But the thing is empty, unfortunately. You can make out a BBQ.
There is an open barn door leading east. There is an open sliding patio door leading west. You don't like doors? Why not try going south, that entranceway is not blocked by one.
> (I see exits to the south, east, and west. My previous exploration covered every branching path coming out of west from the kitchen, so that means what I should do next is head south from here.) S
-= Garden =-
You've entered a garden.
There is an exit to the north. Don't worry, there is no door.
There is a red onion, a green hot pepper, a green bell pepper, a red bell pepper, a yellow onion and a raw yellow potato on the floor.
> (I see an exit to the north. This room is very promising: it has a red onion and a green hot pepper and both are ingredients I need for the recipe. First, let's take the green hot pepper, since that's the first step in the recipe.) GET GREEN HOT PEPPER
You pick up the green hot pepper from the ground.
Your score has just gone up by one point.
> (Nice, now I'll grab the red onion.) GET RED ONION
You pick up the red onion from the ground.
Your score has just gone up by one point.
> (I now have all the ingredients required: a green hot pepper, a red onion, and a white onion. I'll head north to get back to the kitchen and begin Phase III.) N
-= Backyard =-
You arrive in a backyard. An usual one. You begin looking for stuff.
You can make out a patio table. I guess it's true what they say, if you're looking for a patio table, go to TextWorld. However, the patio table, like an empty patio table, has nothing on it. You make out a patio chair. You shudder, but continue examining the patio chair. But the thing is empty, unfortunately. You can make out a BBQ.
There is an open barn door leading east. There is an open sliding patio door leading west. You don't like doors? Why not try going south, that entranceway is not blocked by one.
> (I see exits to the east, south, and west. I'll go west to re-enter the kitchen.) W
-= Kitchen =-
You've entered a kitchen. You can barely contain your excitement.
An open conventional looking fridge is nearby. The fridge contains a raw white tuna. You bend down to tie your shoe. When you stand up, you notice an oven. Suddenly, you bump your head on the ceiling, but it's not such a bad bump that it's going to prevent you from looking at objects and even things. You scan the room for a table, and you find a table. Now why would someone leave that there? The table is massive. Looks like someone's already been here and taken everything off it, though. Sometimes, just sometimes, TextWorld can just be the worst. You see a counter! The counter is vast. On the counter you see a yellow apple, a red hot pepper, a cookbook and a knife. Wow! Just like in the movies! You make out a stove. But the thing is empty.
There is an open sliding patio door leading east. There is an open plain door leading south. You need an exit without a door? You should try going west.
> (I should begin by reading the cookbook, which will refresh my memory of the directions.) READ COOKBOOK
You open the copy of "Cooking: A Modern Approach (3rd Ed.)" and start reading:
Recipe #1
---------
Gather all following ingredients and follow the directions to prepare this tasty meal.
Ingredients:
green hot pepper
red onion
white onion
Directions:
slice the green hot pepper
fry the green hot pepper
chop the red onion
roast the red onion
slice the white onion
fry the white onion
prepare meal
> (Now I'll check my inventory to confirm I have all the necessary ingredients and nothing else.) I
You are carrying: a red onion, a green hot pepper and a white onion.
> (The ingredients match perfectly. I also need to slice the green hot pepper and white onion, so I'll take the knife from the kitchen counter now.) GET KNIFE
You're carrying too many things already.
> (I'll need to make room for the knife in my inventory. So I'll go through the steps in order and go back for the knife once I can drop something. The first step is to slice the green hot pepper.) SLICE GREEN HOT PEPPER WITH KNIFE
You need to take the knife first.
> (I really will need to drop something. Going by where the last slicing step appears in the directions, the green hot pepper will be more convenient to come back for later. The very first thing I'll do then is drop *that*, then pick up the knife, then continue the rest of the procedure for that ingredient.) DROP GREEN HOT PEPPER
You drop the green hot pepper on the ground.
> (Nice, now to pick up the knife.) GET KNIFE
You take the knife from the counter.
> (Good, I have the knife. Now I can slice the white onion first, which becomes more convenient in terms of conserving inventory space.) SLICE WHITE ONION WITH KNIFE
You slice the white onion.
Your score has just gone up by one point.
> (Great, now I'll fry the sliced white onion using the stove.) COOK WHITE ONION WITH STOVE
You fried the white onion.
Your score has just gone up by one point.
> (Now to work with the red onion. Since the red onion first needs chopping and then roasting, I'm better doing both steps back-to-back.) CHOP RED ONION WITH KNIFE
You chop the red onion.
Your score has just gone up by one point.
> (Time to roast the red onion using the oven.) COOK RED ONION WITH OVEN
You roasted the red onion.
Your score has just gone up by one point.
> (Now I'll go pick up that green hot pepper, slice it as my last cutting action, then return the knife before frying it as my last cooking action. To start, I need to pick it back up.) GET GREEN HOT PEPPER
You're carrying too many things already.
> (I need to make inventory room for it, which is easy, since I only kept the knife until I sliced and chopped everything. I'll return it now and then proceed as planned.) DROP KNIFE
You drop the knife on the ground.
> (Now I can pick back up the green hot pepper.) GET GREEN HOT PEPPER
You pick up the green hot pepper from the ground.
> (Perfect, now I can slice the green hot pepper.) SLICE GREEN HOT PEPPER WITH KNIFE
You need to take the knife first.
> (It's true that I need a knife to slice anything, so let's get it back.) GET KNIFE
You're carrying too many things already.
> (I've got an extra item in my inventory space since I'm holding all my ingredients, so I need to do this slice-and-fry step one action ahead of time. Let's drop the roasted red onion to make inventory space.) DROP RED ONION
You drop the red onion on the ground.
> (Now I'll pick up the knife again to proceed with slicing the green hot pepper.) GET KNIFE
You pick up the knife from the ground.
> (Now that I have the knife again, I can slice the green hot pepper.) SLICE GREEN HOT PEPPER WITH KNIFE
You slice the green hot pepper.
Your score has just gone up by one point.
> (Now that the green hot pepper is sliced, I'll need to free space to retrieve the red onion and include in my final inventory. I'll drop the knife now since slicing and chopping are done.) DROP KNIFE
You drop the knife on the ground.
> (Now to pick back up the red onion I placed on the ground earlier, since I want all roasted and fried each ingredient in my final inventory before preparing the meal.) GET RED ONION
You pick up the red onion from the ground.
> (Now I'll complete the frying step for the green hot pepper with the stove.) COOK GREEN HOT PEPPER WITH STOVE
You fried the green hot pepper.
Your score has just gone up by one point.
> (Now that all necessary actions have been done, I'll go ahead and prepare the meal.) PREPARE MEAL
Adding the meal to your inventory.
Your score has just gone up by one point.
> (Now that the meal is prepared, the final step is to eat it.) EAT MEAL
You eat the meal. Not bad.
Your score has just gone up by one point.
*** The End ***
You scored 11 out of a possible 11, in 56 turns.
Would you like to RESTART, RESTORE a saved game, QUIT or UNDO the last command?
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment