the-infocom-files / suspended

Suspended
8 stars 3 forks source link

Double message when turning a dial too far to the right #49

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago
>TURN FIRST DIAL TO THE RIGHT
It can't go right any more.
That setting is out of range.

This is handled by V-SET. Interestingly, it handles left and right a bit different:

     <COND (<EQUAL? ,PRSI ,RIGHT>
        <SETG P-NUMBER <+ .OLDNUM 10>>
        <COND (<G? ,P-NUMBER 100>
               <ROBOT-TELL "It can't go " <>>
               <COND (<EQUAL? ,PRSO ,LEVER1 ,LEVER2 ,LEVER3>
                  <TELL "forward">)
                 (T
                  <TELL "right">)>
               <TELL " any more." CR>)>)
           (<EQUAL? ,PRSI ,LEFT>
        <COND (<EQUAL? .OLDNUM 0>
               <ROBOT-TELL "It can't go " <>>
               <COND (<EQUAL? ,PRSO ,LEVER1 ,LEVER2 ,LEVER3>
                  <TELL "back">)
                 (T
                  <TELL "left">)>
               <TELL " any more." CR> <RTRUE>)
              (<L? .OLDNUM 10>
               <SETG P-NUMBER 0>)
              (ELSE
               <SETG P-NUMBER <- .OLDNUM 10>>)>)>

Turning it to the left does not print double messages in any case I've been able to find.