Glimmr Form Fields

version 1/101201 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Help building lists of character codes

    The following code (a complete "game") can be used to create a loop for building lists of character codes. You can run this code, type each character you want in your list, and then copy and paste the list into your story text.

        When play begins:
            say "Press any key to see the character code.";
            let L be a list of numbers;
            while true is true:
                wait for any key;
                say "Input: [the keystroke-code cleansed for printing].";
                add keystroke-code to L;
                say "List of keystroke-codes entered:[line break]";
                repeat with N running from 1 to the number of entries of L:
                    say "[if N is 1]{ [entry N of L][otherwise], [entry N of L][end if]";
                say " }.";
                say "Corresponding keystrokes:[line break]";
                say "{ ";
                repeat with N running from 1 to the number of entries of L:
                    unless N is 1:
                        say ", ";
                    let T be entry N of L resolved to an indexed text;
                    if T is "":
                        say "<special>";
                    if T is " ":
                        say "<space>";
                    otherwise:
                        say "[T]";
                say " }."

        Test is a room.