Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Phrases to convert character input to indexed text
        
    To decide which indexed text is (N - a number) resolved to an/-- indexed text:
        if (N > 31 and N < 127) or (N > 160 and N < 384):[i.e., we have a standard keystroke and not an unprintable one]
            decide on "[char-code (N)]";
        otherwise:
            decide on "".
            
    To say char-code (N - a number):
        (- print (char) {N}; -)

    To wait for any key:
        now keystroke-code is the null char;
        while keystroke-code is the null char:
            process the character input loop.

    To wait for the/-- SPACE key:
        now keystroke-code is the null char;
        while keystroke-code is not 13 and keystroke-code is not 31 and keystroke-code is not 32:
            process the character input loop.