the-infocom-files / hitchhiker

The Hitchhiker’s Guide to the Galaxy
21 stars 4 forks source link

You can hitchhike even when the thumb is in a closed satchel #24

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago
>WHO AM I
You are Ford Prefect.

>INVENTORY
You have:
  a satchel

>HITCHHIKE
The Thumb winks and flashes for a second. Nothing further happens.

>EXAMINE THUMB
You can't see any thumb here!

The problem is in the assumption that V-HITCHHIKE does:

<ROUTINE V-HITCHHIKE ()
     <PERFORM ,V?PUSH ,GREEN-BUTTON>
     <RTRUE>>
<ROUTINE GREEN-BUTTON-F ()
     <COND (<VERB? PUSH>
        <COND (<NOT <HELD? ,THUMB>>
               <TELL ,NOT-HOLDING " the " D ,THUMB "." CR>
               <SETG P-IT-OBJECT ,THUMB>)

The HELD? routine checks if the object is in the player, or in a container held by the player. It doesn't check if the container is open. Which usually isn't a problem, because you wouldn't be able to refer to the object if it wasn't visible.

So it should presumably be like this, though I haven't tested it:

<ROUTINE V-HITCHHIKE ()
     <COND (<NOT <VISIBLE? ,THUMB>>
        <CANT-SEE ,THUMB>)
           (T
        <PERFORM ,V?PUSH ,GREEN-BUTTON>
        <RTRUE>)>>
eriktorbjorn commented 4 years ago

V-GET-DRESSED has the same problem, because it only checks if the gown is HELD?. Not if it's also ACCESSIBLE?.

>PUT GOWN IN TOOL BOX
Done.

>CLOSE TOOL BOX
Okay, the tool box is now closed.

>EXAMINE GOWN
You can't see any gown here!

>GET DRESSED
You are now wearing your gown.
eriktorbjorn commented 4 years ago

V-BRUSH also has the same problem, for the same reason:

>PUT TOOTHBRUSH IN TOOL BOX
Done.

>CLOSE TOOL BOX
Okay, the tool box is now closed.

>EXAMINE TOOTHBRUSH
You can't see any toothbrush here!

>BRUSH TEETH
(with the toothbrush)
Congratulations on your fine dental hygiene.