Understand phrase doesn't work with numbers

This code works fine:

Lab is a room.

The camera is a thing in the lab.

The printed name of the camera is "new red camera".
The description of the camera is "That is definitely the [printed name]!".
Understand "new/-- red/-- camera" as the camera.

Results:

>x camera
That is definitely the new red camera!

>x new camera
That is definitely the new red camera!

>x red camera
That is definitely the new red camera!

>x new red camera
That is definitely the new red camera!

But this code does not work as expected:

Lab is a room.

The camera is a thing in the lab.

The printed name of the camera is "new BR-8008 camera".
The description of the camera is "That is definitely the [printed name]!".
Understand "new/-- br-8008/-- camera" as the camera.

Results:

>x camera
That is definitely the new BR-8008 camera!

>x new camera
You can't see any such thing.

>x BR-8008 camera
You can't see any such thing.

>x new BR-8008 camera
You can't see any such thing.

I get similar bad results when I remove the hyphen and use “BR8008” instead.

I know there are workarounds for this. I am wondering if this is a bug. Some sort of edge case involving numbers in understand phrases maybe?

2 Likes

If you look at the generated I6 code, you’ll see that it’s checking for the required word 'br-8008/--' instead of the optional word 'br-8008'. So it’s definitely a compiler bug (parsing the optional syntax.)

You can do this for nearly the same effect:

Understand "new", "br-8008", "camera" as the camera.

This will also accept TAKE BR-8008 NEW CAMERA or even TAKE NEW BR-8008. But players aren’t going to complain.

4 Likes

FYI, issue filed here.

1 Like

Issue has been fixed for next release.

Confirmed that this issue is fixed in Inform 10.1.2.

1 Like