Check rule

I7 and I don’t seem to agree that I’m following the check rules correctly. As usual, I7 wins.

Check entering studio door: if player does not carry guitar: say "'Where[']s your guitar, boy? Cain[']t record no song without no guitar.['] Sam says as he ushers you back out to Union Street."; otherwise: if player does not carry 50 dollars: say "Sam Phil greets you in the lobby of Moon Studios.[line break] Sam, looking mournful, says [']Looks like we[']re out of luck, Rocky. The mortgage is due today and I ain[']t got the fifty dollars to cover it. If I don[']t pay the man by 6:00, I[']m out of business![line break] Too bad, too. That [']Shamba-Lamba-Wamba, Do You Wanna Be My Baby?['] song of yours is solid gold. It coulda been a million-seller!['][line break] With a sorrowful shake of his head, Sam leads you back out to Union Street.[line break] [']If only there was some way of raising that fifty bucks,['] Sam says as he waves goodbye to you."; now player is in A Street; otherwise: say "[']You here again?['] Sam says. [']You got the money?[']"

Problem message:

Problem. You wrote ‘otherwise’ : but this doesn’t match a corresponding ‘if’, as it must. An ‘otherwise’ must be vertically underneath the ‘if’ to which it corresponds, at the same indentation, and if the ‘otherwise’ uses a colon to begin a block then the ‘if’ must do the same.


Problem. The phrase or rule definition ‘Check entering studio door’ is written using the ‘colon and indentation’ syntax for its ‘if’s, ‘repeat’s and ‘while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘say "[’]You here again?[’] Sam says. [’]You got the money?[’]"’ , in case that helps.

Check your indentation on “now player is in A Street”. It’s even with the indentation from “if player does not carry guitar/otherwise”, where it should be even with “say ‘Sam Phil greets you…’” instead.

Thanks, I made that correction, but I7 still isn’t satisfied.

Problem message:

Problem. The phrase or rule definition ‘Check entering studio door’ is written using the ‘colon and indentation’ syntax for its ‘if’s, ‘repeat’s and ‘while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘say "[’]You here again?[’] Sam says. [’]You got the money?[’]"’ , in case that helps.

Your if’s and otherwise’s all have to be in a line, with the same number of initial tabs (or spaces). It’s how the engine determines which otherwise’s belong to which if’s and which statements after the if should be executed. For instance, something like:

if night is day: say "Night is day!" say "Up is down!"

will print nothing (assuming night is not day.) But

if night is day: say "Night is day!" say "Up is down!"

will print “Up is down!” because the second say statement is indented backward and so is not part of the if statement.

Check entering studio door: if player does not carry guitar: say "'Where[']s your guitar, boy? Cain[']t record no song without no guitar.['] Sam says as he ushers you back out to Union Street."; otherwise if player does not carry 50 dollars: say "Sam Phil greets you in the lobby of Moon Studios.[line break] Sam, looking mournful, says [']Looks like we[']re out of luck, Rocky. The mortgage is due today and I ain[']t got the fifty dollars to cover it. If I don[']t pay the man by 6:00, I[']m out of business![line break] Too bad, too. That [']Shamba-Lamba-Wamba, Do You Wanna Be My Baby?['] song of yours is solid gold. It coulda been a million-seller!['][line break] With a sorrowful shake of his head, Sam leads you back out to Union Street.[line break] [']If only there was some way of raising that fifty bucks,['] Sam says as he waves goodbye to you."; now player is in A Street; otherwise: say "[']You here again?['] Sam says. [']You got the money?[']"

Still getting a problem with those indents.
But I noticed something and tried to fix it, and that’s not working either – having to do with the amount of money carried.

[code]The wallet is a portable container. It is inside the drawer.

The wallet has a number called dollars. The dollars are 0.

Check entering studio door:
if player does not carry guitar:
say “‘Where[’]s your guitar, boy? Cain[’]t record no song without no guitar.[’] Sam says as he ushers you back out to Union Street.”;
otherwise:
if player does not carry wallet:
if the number of the wallet is not 50 dollars:
say “Sam Phil greets you in the lobby of Moon Studios.[line break]
Sam, looking mournful, says [’]Looks like we[’]re out of luck, Rocky. The mortgage is due today and I ain[’]t got the fifty dollars to cover it. If I don[’]t pay the man by 6:00, I[’]m out of business![line break]
Too bad, too. That [’]Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[’] song of yours is solid gold. It coulda been a million-seller![’][line break]
With a sorrowful shake of his head, Sam leads you back out to Union Street.[line break]
[’]If only there was some way of raising that fifty bucks,[’] Sam says as he waves goodbye to you.”;
now player is in A Street;
otherwise:
say “[’]You here again?[’] Sam says. [’]You got the money?[’]”[/code]

Problem message:

Problem. In the sentence ‘if the number of the wallet is not 50 dollars’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘number of the wallet is not 50 dollars’.

I was trying to match this phrase:

if (number of the wallet is not 50 dollars - a condition):

But I didn’t recognise ‘number of the wallet is not 50 dollars’.


Problem. You wrote ‘otherwise’ : but that makes two unconditional ‘otherwise’ or ‘else’ clauses for this ‘if’, which is forbidden since ‘otherwise’ is meant to be a single (optional) catch-all clause at the end.

Problem 1) Try “dollars of the wallet” The wallet has dollars, not a number; dollars are a kind of number.

Well, I’ll be a hog in a mud wallow!
Whole thing compiled.
Thanks once again, Matt_W. I’ll list you as co-author if you want.

Lol. Not necessary:) I’m actually learning Inform myself, and based on long experience learning programming systems, the best way to drill down to the details and figure it out is to go onto a user forum, see what problems and ambiguities other people are encountering, and try to work through them. So you’re helping me as much as the reverse.