Naming things: problems with numbers

Today’s question is about naming something with a number.
For instance:
The 1 is a button.

This does not work. I can easily do this with letters:

The A is a button.

And then I can say “push A” and everything is great. But not so with numbers. In order to get my button-pushing code to work, I need to be able to have the [name] of a numbered button be just the number. Is there a way to get Inform to read “1 Button” as simply “1”? Or to say something like:

 if the name of the noun contains a number:
    now the name of the noun is the number.

Or to get it to understand only the first character of a button’s name (A Button is just A, 1 Button is just 1)?

Does that make any sense?

Does this work?

The one-button is in test chamber.  Understand "1" as the one-button.  The printed name of the one-button is "1".
1 Like

This looks like a job for understanding things by their properties.

I’d avoid naming something simply “A”, which seems like begging for trouble.

So one might start with something like

A button is a kind of thing.
Buttons are usually fixed in place.
A labelled-button is a kind of button.
A labelled-button has a text called the button-label.
A numbered-button is a kind of button.
A numbered-button has a number called the button-number.
Understand the button-number property as describing a numbered-button.
Understand the button-label property as describing a labelled-button.
Pressing is an action applying to one thing.
Understand the command "press" as something new.
Understand "press button/-- [button]" as pressing.
Understand "push button/-- [button]" as pressing.
Before pushing a button, instead try pressing the noun.

and then add details to actually make it work. :grinning:

3 Likes

Yes, yes. This is it. “The button-number property as describing” is what I was looking for.

I am so proud of myself. I made a code from scratch that is fairly simple and allows pressing 36 buttons, gets the right result on the correct 2-button code, but that is quite short. Oh, joy.

3 Likes