the-infocom-files / sorcerer

Sorcerer
3 stars 3 forks source link

NOW-BLACK prints unnecessary newline #24

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

The NOW-BLACK routine is simply this:

<ROUTINE NOW-BLACK ()
     <TELL "It is now pitch black." CR>>

It's called in two places. The first one is in V-LAMP-OFF:

               <TELL "Okay,">
               <ARTICLE ,PRSO T>
               <TELL " is now off." CR>
               <COND (<AND <NOT <SETG LIT <LIT? ,HERE>>>
                   <NOT ,BLORTED>>
                  <NOW-BLACK>
                  <CRLF>)>)>)

This prints an extra blank line if turning off your only light source turns the room dark:

>INVENTORY
You are carrying:
  a brass lantern (providing light)
  a grue suit (being worn)

>TURN OFF LAMP
Okay, the brass lantern is now off.
It is now pitch black.

>

The second one is in V-CLOSE:

               <TELL "Closed.">
               <SETG LIT <LIT? ,HERE>>
               <COND (<AND <NOT ,LIT>
                   <NOT ,BLORTED>>
                  <TELL " ">
                  <NOW-BLACK>)>
               <CRLF>)

Which prints an extra newline if you close an object containing your only light source:

>INVENTORY
You are carrying:
  a tiny box
  The tiny box contains:
    a magic amulet (providing light)

>CLOSE BOX
Closed. It is now pitch black.

>

It seems to me that the easiest fix should be to remove the newline from NOW-BLACK.