Unicode Characters as player input

I have the characters entering an infinite hallway, with doors labelled from 1 to ∞. I would like to have a joke response if someone tries to open door “∞”. However, inform won’t parse the infinity symbol as a part of the text, as it registers it as a unicode character.

Is there a way I can get inform to understand the player’s input of the ∞ symbol so I can make a response if they try to open the infinite door.

There are two relatively straightforward approaches, neither of which may be satisfactory.

  1. If you’re comfortable with building things from source, use the current development version of Inform: it can handle arbitrary unicode in player input and grammar lines.
  2. Wait for the next release of Inform, for which there’s not yet a schedule.
1 Like

Yep, it’s a long-standing limitation in Inform, which will be fixed in the next release.

But given that the last release took eight years to come out, that may be a long while off.

1 Like

Or, allow OPEN DOOR ONE, etc. as ways to open the doors and use OPEN DOOR INFINITY. This falls apart if you’re planning to allow OPEN DOOR 1098340917 unless you’d like to implement OPEN DOOR ONE TRILLION, NINETY-EIGHT BILLION, THREE HUNDRED FORTY MILLION, NINE HUNDRED SEVENTEEN and the non-American equivalent.

That’s actually a default feature of Inform: you can use ONE and 1 interchangeably in player input. I believe the limit for this feature is 19 thirty, see below; anything higher needs digits, not words.

I suspect a problem if one tried open door 2,147,483,648. Or does Inform implement bigints?

Not yet! Though someone could write an extension/kit for them.

1 Like

Oh welp, never mind then.

Thirty.

1 Like

What does bigint mean in this context? Does inform default to 8-bit unsigned integers because that was a common limitation back in the day and inform tries to maintain compatibility with old standards or does inform have a larger default size for integers?

Glulx integers are 32 bits, Z-Code integers are 16 bit. Bigints refer to multi-word integers of unlimited length, kind of like as if they were stored as texts (though usually more efficiently than that). The downside is that any maths you want to do with them is considerably slower.

1 Like

By “bigint” I was just thinking of any high-precision integer representation, although I was specifically thinking of Java’s BigInteger class, which is arbitrary precision.

As to your second question, it depends on the virtual machine. Z-code supports 16-bit signed integers, whereas glulx supports 32-bit. Someone correct me if I’m wrong about that.

Your question about compatibility I don’t know the answer to.

Dannii scooped me :slight_smile: