More fun re-learning Inform 6 (exploring the parser)

I was just implementing (for the fun of it, I’ll probably never finish an actual game) a puzzle involving 8 buttons on a locked door. Relatively simple, making a class Button and filling in specifics later. I started getting into deeper waters because 2 of the buttons are N and S, resulting in:

>PUSH N
(the north wall)

You can't do that.

So I thought I’d get clever and put react_before and ‘push self’ on the N and S buttons. It worked, but still printed “(the north wall)” before the text about the button being pushed. So I turned on messages and trace 5 and looked at the scoring system the parser uses in DM4.
Turns out, changing ‘concealed’ to ‘scenery’ fixed the problem perfectly.

Then, as you can imagine, the “A” button caused no end of headaches. “push a” would work, but “push a button” worked (odd it didn’t as ‘which button…’) Again, reading the scoring system gave me an idea: I gave the button class ‘pluralname’ and the A button ‘~pluralname’. That gave it a higher score!
Nothing really spectacular here, just felt like sharing. Have a great evening.

1 Like

There’s a long-standing IF tradition of buttons labelled B, C, F, H, J, K, M, P, R, T, V, and Y.

7 Likes

No doubt! :nerd_face: Due to the nature of the puzzle, though the choice of letters was non-negotiable.

I think I have figured the puzzle… the button must be pressed in the order of a specific (pass)word, isn’t ? :wink:

Best regards from Italy,
dott. Piergiorgio.

Yep. A word is on the door, spelled out with the buttons. It will give you a clue if you examine the door after pushing a button or two:
"
The remaining letters spell (whatever), which doesn’t look like a word."
The buttons spell “STARLING”.

I actually found this in a Martin Gardener book. If you haven’t figured out what you’re supposed to do I’ll give you another hint later. :+1:

I should have put that with spoiler protection but I don’t know how! :face_with_raised_eyebrow:

You can either protect a passage by “manually” typing spoiler tags like this: “[spoiler] bla [/spoiler]”, which will look like this: bla , or you can select/highlight a passage with the mouse, then click the cogwheel in the upper right of the editing window, then click “Blur Spoiler”, which will insert the spoiler tags around the marked text (leading to the same result).

1 Like

Thank you very much!