"if player consents" hangs

I have a program that plays a betting game. I use if player consents (or unless player consents) multiple times, but not nested. After the second question, the output hangs SOMETIMES. I can play a few rounds then after entering Y or N to if player consents questions, I see the Y or N but nothing happens after that–even with RULES running.
Here is a code excerpt that runs in my test sandbox.

To setup topper:
	[Is Game on?]
	say " 'Would you like to play a little? Maybe make a few coins?' ";
	unless player consents:			
		say "[TopperDealer] looks disappointed, then says, 'Maybe some other time, then.' ";
		rule succeeds;
	[Player getst the rules only the first time]	
	say "[first time][description of TopperRules][only]";
	say " 'After hearing the rules, do you still want to play?' ";
	[Player changes his mind?]
	if player consents:
		say "He changed his mind[line break]";
	otherwise:
		now BettingMode is true;
	rule succeeds;	

After working with ChatGPT for a few days, we think there might be an interpreter bug. I;m using Version 1.8.2.

Also, there has been some debate about rule succeeds being used in a phrase, and not a strict rule. What’s the thinking on this. If no, then how to kickout of a phrase?

On the last question, the standard way to bail out of a phrase is “stop”.

Then what interpreter are you using?

1 Like

Between “there’s an interpreter bug” and “ChatGPT is reasoning incorrectly about Inform 7 code”, I’d expect the second to be more likely. But in any case I don’t think anyone is likely to be able to help without seeing all of the code that governs the behaviour you’re talking about. What happens when BettingMode gets set to true?

3 Likes

Thanks.

Tobias,
How do I find that out. If I clikc on ABOUT INFORM, I get Version 1.82. Is that only for the IDE? I have the latest download, if that helps.

I can send more, but the program is pretty long. The misbehavior is happening on the second “If player consents” question: Do you still want to play?" Regardless of the answer, sometimes it stop dead, even with the rules on, there is no more output, nor the command prompt/

If you go into “Settings” or “Preferences” (depending on the platform), there should be a dropdown to switch between Git and Glulxe as the interpreter. Switch to the other and see if the problem is still there; that will indicate if it’s an interpreter issue or not.

Thanks. I switched from Glulxe to git and the problem persists. Not an interpreter problem.

Here is the entire game. I put it into a sandbox to simplify testing.
Oops! This website won’t let me upload a .inform file. How can I get the code up?

The .inform file is actually a folder containing various different files. Your game’s source code lives in the file called story.ni. Alternatively, you could cut and paste the code of the game here, inside a “hide details” box, if it fits within the character limit, or share a link to an external site like pastebin.