I had an idea to make a little extension that would automatically number the options at the end of the game, similar to the way Aaron Reed’s Numbered Disambiguation Choices extension numbers objects.
So, for example, if your question started out like this:
Would you like to RESTART, RESTORE a saved game, SING a song, QUIT or UNDO the last command?
The extension would display it like this instead:
Would you like to 1) RESTART, 2) RESTORE a saved game, 3) SING a song, 4) QUIT or 5) UNDO the last command?
or, if you prefer, like this:
1) RESTART
2) RESTORE a saved game
3) SING a song
4) QUIT
5) UNDO the last command
and players could enter either the number or the keyword.
Anybody want to try it out, test it, offer feedback?
Version updated May 8, 2026
Version 1/260508 of Numbered Final Question Options by Alice Grove begins here.
"Options that appear at the end of a game, for example, 'RESTORE the game' and 'see some suggestions for AMUSING things to do,' typically rely on capitalization to show which keyword to type. This extension aims to make the options more screen reader friendly by numbering them. Players can respond with either a number or a keyword."
Section - Table of Final Option Numbers
Table of Final Option Numbers
printed number (text) matchable number (topic) printed option (text)
"1" "1"
"2" "2"
"3" "3"
"4" "4"
"5" "5"
"6" "6"
"7" "7"
"8" "8"
"9" "9"
Section - New Variables
The chosen table of final options is a table name that varies.
The chosen table of final options is usually the Table of Final Question Options.
List-final-options-vertically is a truth state that varies.
List-final-options-vertically is usually false.
Section - Printing the Final Question with Numbered Options
This is the print the final question with numbered options rule:
let named options count be 0;
repeat through the chosen table of final options:
if (the only if victorious entry is false) or (the story has ended finally):
if (there is a final response rule entry) or (the final response activity entry is not empty):
if there is a final question wording entry:
increase named options count by 1;
if named options count is less than 1:
abide by the immediately quit rule;
if list-final-options-vertically is false:
say "Would you like to " (A);
otherwise if list-final-options-vertically is true:
say "What would you like to do?[paragraph break]" (B);
repeat through the Table of Final Option Numbers:
if there is a printed option entry:
blank out the printed option entry;
repeat through the chosen table of final options:
if (the only if victorious entry is false) or (the story has ended finally):
if (there is a final response rule entry) or (the final response activity entry [activity] is not empty):
if there is a final question wording entry:
let corresponding option be the final question wording entry;
let current option number be a text;
repeat through the Table of Final Option Numbers:
if (there is no printed option entry) and (there is a printed number entry):
now the printed option entry is the corresponding option;
now the current option number is the printed number entry;
break;
if list-final-options-vertically is false:
say "[current option number]) [final question wording entry]" (C);
decrease named options count by 1;
if the named options count is 1:
if the serial comma option is active, say "," (D);
say " or " (E);
otherwise if the named options count is 0:
say "?[line break]" (F);
otherwise:
say ", " (G);
otherwise if list-final-options-vertically is true:
say "[current option number]) [final question wording entry][line break]" (H);
decrease named options count by 1;
if the named options count is 0:
say line break;
The print the final question with numbered options rule is listed instead of the print the final question rule in the before handling the final question rulebook.
Section - Responding to the Player's Numbered Final Selection
This is the respond to the player's numbered final selection rule:
[Check if the player entered a number that matches one of the available options]
let corresponding option be "";
repeat through the Table of Final Option Numbers:
if there is a matchable number entry:
if (the player's command matches the matchable number entry) and (there is a printed option entry):
now the corresponding option is the printed option entry;
break;
[If the player has entered a number that matches an available option, carry out that option]
if corresponding option is not "":
repeat through the chosen table of final options:
if (the only if victorious entry is false) or (the story has ended finally):
if (there is a final response rule entry) or (the final response activity entry [activity] is not empty):
if there is a final question wording entry:
if the final question wording entry is the corresponding option:
if there is a final response rule entry:
abide by final response rule entry;
otherwise:
carry out the final response activity entry activity;
rule succeeds;
[The player did not enter a valid number, so check for keywords]
repeat through the chosen table of final options:
if (the only if victorious entry is false) or (the story has ended finally):
if (there is a final response rule entry) or (the final response activity entry is not empty):
if the player's command matches the topic entry:
if there is a final response rule entry:
abide by final response rule entry;
otherwise:
carry out the final response activity entry activity;
rule succeeds;
[The player's command didn't match a number or keyword]
say "Please enter a number or keyword from the options above." (A).
The respond to the player's numbered final selection rule is listed instead of the standard respond to final question rule in the for handling the final question rulebook.
Numbered Final Question Options ends here.
---- DOCUMENTATION ----
Often, Inform games end with a question something like this: "Would you like to RESTART, RESTORE a saved game, see some suggestions for AMUSING things to do, QUIT or UNDO the last command?" Capitalization is used to show which word the player is expected to type.
This extension automatically adds a number in front of each option, for up to nine options, with the goal of being more screen reader friendly. The player can respond by entering either the number or a keyword. It's no longer necessary to rely on capitalization to find out what to type.
The extension allows printing the options in a sentence or in a vertical list.
Section: Basic use
If we just want to add the numbers and don't want to set any special options, we can simply include the extension, and do nothing else:
*: Include Numbered Final Question Options by Alice Grove.
Section: Using a different table of options
By default, Inform stores the final options in a table called Table of Final Question Options. However, if we create a new table of options to use instead--for example, a Table of Fancy Final Options--we can add the line
The chosen table of final options is the Table of Fancy Final Options.
and the Table of Fancy Final Options will be used instead. If we make a new table, we need to make sure the column names and types are identical to the ones in the Table of Final Question Options. See "§11.6 Ending The Story" in the documentation for details about that table. We do not need to number the entries in the table--the extension will number the options automatically when they are printed.
Section: Printing the options in a vertical list
If we would rather the options be printed in a vertical list instead of in a sentence, we can add the line
*: List-final-options-vertically is true.
and the resulting text will look something like this:
What would you like to do?
1) RESTART
2) RESTORE a saved game
3) QUIT
4) UNDO the last command
If we are using a vertical list, and if we'd like to add a period at the end of each option to encourage screen readers to pause between options rather than running them together, we can change response H in the "print the final question with numbered options" rule to include a period. If our game has a screen reader mode, and if we want to display the period if the game is in screen reader mode, we can do something like this:
*: Screen reader mode is a truth state that varies.
Print the final question with numbered options rule response (H) is "[current option number]) [final question wording entry][if screen reader mode is true].[end if][line break]".
When we add periods to a vertical list, the result should look something like this:
What would you like to do?
1) RESTART.
2) RESTORE a saved game.
3) QUIT.
4) UNDO the last command.
Section: Limitations
If a player tries to enter both the number and the keyword together, or tries to include the ")" symbol following the number, that will not be understood.
If we want to include more than nine options in the final question, we'll need to continue the Table of Final Question Numbers (begun in this extension) to add more numbers. If we have ten or more options, and we also want to list the options vertically, then the text of the options will not line up (since the numbers won't all have the same numbers of digits and won't be the same width).
Example: * Jump In - A minimal example.
*: Include Numbered Final Question Options by Alice Grove.
Diving Board is a room. The description is "Don't wait! All you need to do is jump!"
Rule for amusing a victorious player: say "Have you tried waiting?"
Carry out waiting:
end the story saying "YOU HAVE LOST".
Carry out jumping:
end the story finally saying "YOU HAVE WON".
Test me with "jump".
(Related thread: Table of Final Question Options: allowing synonyms )
[Edit: Added updated version]
[Edit: Added another updated version]