Hi, have you heard of the Custom GPT: Inform 7 Buddy. It helps you write code similarly to how VS Code has Copilot. It can be found on the ChatGPT App.
Here is how I used it recently. In my Zork like adventure, I wanted a puzzle which went like this. You need to go on a treadmill, to earn a loaf of bread which you give to a beggar, in order to receive a powerful amulet.
This is complicated by the fact that you need to go on the treadmill three times in order to earn your loaf. Further, the Beadle prevents you from going on the treadmill without you giving him a work permit, which you can receive elsewhere in the adventure from a Job Coach in the Employment Exchange.
This is probably too vague a description for I7 Buddy, so I entered the following prompt:
can you give me the code for the following puzzle: The game starts with variable workhouse_state set to 0. after entering employment exchange with workhouse_state set to 0, The job coach says “Greetings traveller. There is some work available in the work house are you interested?” If the player says yes: the job coach says “You’ll need this permit though!” He hands the player the permit and workhouse_state is set to 1. after entering the workhouse with workhouse_state set to 0: the beadle says “You’ll need a permit to do some work before I can give you a loaf of bread.” After entering rhe workhouse with workhouse_state set to 1 and player is carrying the permit, the beadle says “Hand me that permit and then have a go on the treadmill.” If the player gives the beadle the permit then workhouse_state is set to 2. If the player then goes on the treadmill: he works for fifteen minutes before collapsing on the floor exhausted. Then the workhouse_state is set to 3. The Beadle says “You’ll need to work harder than that for your bread.” When workhouse_state is set to 3, if the player tries to go on the treadmill, The beadle prevents him and says "You’ll need another work permit. After entering the employment exchange when workhouse_state is set to 3, the Job coach says “There’s more work at the workhouse. Are you interested?” If the player says yes. The job coach gives him the permit and workhouse_state is set to 4. If the player enters the workhouse with workhouse_state set to 4. The beadle says “Hand me that permit and then have a go on the treadmill.” If the player gives the beadle the permit then workhouse state is set to 5. If the player then goes on the treadmill: he works for another fifteen minutes before collapsing, and coughing up blood. Then the workhouse state is set to 6. The Beadle says “You’ll need to work harder than that for your bread.” When workhouse_state is set to 6, and the player tries to go on the treadmill, The beadle prevents him and says "You’ll need another work permit. After entering the employment exchange when workhouse_state is set to 6, the Job coach says “There’s more work at the workhouse. Are you interested?” If the player says yes. The job coach gives him the permit and workhouse_state is set to 7. If the player enters the workhouse with workhouse_state set to 7. The beadle says “Hand me that permit and then have a go on the treadmill.” If the player gives the beadle the permit then workhouse state is set to 8. If the player then goes on the treadmill: he works for another fifteen minutes before collapsing, and coughing up more blood. workhouse_state is set to 9, and finally the beadle gives the player a loaf of bread.
As you can see this is pretty exact, but not very pretty. Here is the response I got:
"The Workhouse Puzzle" by You
The Employment Exchange is a room. "A dingy office with yellowing posters about job readiness programs."
The Workhouse is east of the Employment Exchange. "The grim, echoing interior of the workhouse. A treadmill dominates the room."
The Job Coach is a man in the Employment Exchange. The Beadle is a man in the Workhouse.
The player carries nothing.
The treadmill is a device in the Workhouse. The treadmill is switched off.
The permit is a thing. The permit is nowhere.
The loaf of bread is a thing. The loaf of bread is nowhere.
Workhouse_state is a number that varies. Workhouse_state is 0.
To offer-permit:
say "The Job Coach says, 'You'll need this permit though!'";
now the player carries the permit;
increase workhouse_state by 1.
To beadle-request:
say "The Beadle says, 'Hand me that permit and then have a go on the treadmill.'";
To treadmill-collapse:
say "You work for fifteen minutes before collapsing on the floor, exhausted.";
increase workhouse_state by 1;
if workhouse_state is 3:
say "The Beadle sniffs. 'You'll need to work harder than that for your bread.'";
if workhouse_state is 6:
say "You cough up blood. The Beadle crosses his arms. 'You'll need to work harder than that for your bread.'";
if workhouse_state is 9:
say "You cough up more blood. The Beadle nods, satisfied. 'You've earned this.'";
now the player carries the loaf of bread.
After going to the Employment Exchange:
if workhouse_state is 0:
say "The Job Coach says, 'Greetings traveller. There is some work available in the workhouse. Are you interested?'";
else if workhouse_state is 3:
say "The Job Coach says, 'There's more work at the workhouse. Are you interested?'";
else if workhouse_state is 6:
say "The Job Coach says, 'There's more work at the workhouse. Are you interested?'";
else if workhouse_state is 9:
say "The Job Coach looks at you with pity. 'There’s no more work for you, friend.'";
Understand "yes" as saying yes.
Saying yes is an action applying to nothing.
Carry out saying yes:
if the location is the Employment Exchange and (workhouse_state is 0 or workhouse_state is 3 or workhouse_state is 6):
offer-permit;
otherwise:
say "No one responds.";
After going to the Workhouse:
if workhouse_state is 0:
say "The Beadle says, 'You'll need a permit to do some work before I can give you a loaf of bread.'";
else if (workhouse_state is 1 or workhouse_state is 4 or workhouse_state is 7) and the player carries the permit:
beadle-request.
Instead of giving the permit to the Beadle:
if (workhouse_state is 1 or workhouse_state is 4 or workhouse_state is 7):
remove the permit from play;
increase workhouse_state by 1;
say "You hand over the permit. The Beadle grunts approvingly.";
else:
say "The Beadle sneers. 'That's no use to me now.'";
Instead of switching on the treadmill:
if workhouse_state is 2 or workhouse_state is 5 or workhouse_state is 8:
treadmill-collapse;
else if workhouse_state is 3 or workhouse_state is 6:
say "The Beadle blocks your path. 'You'll need another work permit.'";
else:
say "You're not sure how to use the treadmill yet.";
Instead of entering the treadmill:
try switching on the treadmill.
As you can see a massive improvement. Unfortunately it didn’t work right out of the box, and I had to spend another hour debugging
Here is the code I finally used:
Workhouse_state is a number that varies. Workhouse_state is 0.
To offer-permit:
say "The Job Coach says, 'You'll need this permit though!'";
now the player carries the permit;
increase workhouse_state by 1.
To beadle-request:
say "The Beadle says, 'Hand me that permit and then have a go on the treadmill.'";
To treadmill-collapse:
say "You work for for hours before collapsing on the floor, exhausted.";
increase workhouse_state by 1;
if workhouse_state is 3:
say "The Beadle sniffs. 'You'll need to work harder than that for your bread.'";
if workhouse_state is 6:
say "You cough up blood. The Beadle crosses his arms. 'You'll need to work harder than that for your bread.'";
if workhouse_state is 9:
say "You cough up more blood. The Beadle nods, satisfied. 'You've earned this.'";
now the player carries the loaf of bread.
After going to the Employment Exchange:
try looking;
if workhouse_state is 0:
say "The Job Coach says, 'Greetings traveller. There is some work available in the workhouse. Are you interested?'[line break]Type accept if you are.'";
else if workhouse_state is 3:
say "The Job Coach says, 'There's more work at the workhouse. Are you interested?'[line break]Type accept if you are.";
else if workhouse_state is 6:
say "The Job Coach says, 'There's more work at the workhouse. Are you interested?'[line break]Type accept if you are.";
else if workhouse_state is 9:
say "The Job Coach looks at you with pity. 'There’s no more work for you, friend.'";
Agreeing is an action applying to nothing.
Understand "accept" as agreeing.
Carry out agreeing:
if the location is the Employment Exchange and (workhouse_state is 0 or workhouse_state is 3 or workhouse_state is 6):
offer-permit;
otherwise:
say "There's nothing to agree to right now.";
After going to the Workhouse:
try looking;
if workhouse_state is 0:
say "The Beadle says, 'You'll need a permit to do some work before I can give you a loaf of bread.'";
else if (workhouse_state is 1 or workhouse_state is 4 or workhouse_state is 7) and the player carries the permit:
beadle-request.
Instead of giving the permit to the Beadle:
if (workhouse_state is 1 or workhouse_state is 4 or workhouse_state is 7):
remove the permit from play;
increase workhouse_state by 1;
say "You hand over the permit. The Beadle grunts approvingly.";
else:
say "The Beadle sneers. 'That's no use to me now.'";
Instead of switching on the treadmill:
if workhouse_state is 2 or workhouse_state is 5 or workhouse_state is 8:
treadmill-collapse;
else if workhouse_state is 3 or workhouse_state is 6:
say "The Beadle blocks your path. 'You'll need another work permit.'";
else:
say "The Beadle scowls. 'You need a permit before you so much as touch that treadmill, whelp.'";
Instead of entering the treadmill:
try switching on the treadmill.
The main bugbear is that inform 7 v10 doesn’t allow you to redefine yes, so I need to type accept instead as an answer to the Job Coach’s question. It took a long time before I7 Buddy suggested the answer.
What do you think. Is AI the future of IF programming?