the-infocom-files / witness

The Witness
3 stars 4 forks source link

Asking Mr. Linder about generic wires or keys is tricky #24

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

These two cases in LINDER-F are probably a bit harder to trigger than what was intended:

          (<EQUAL? .OBJ ,GENERIC-GREEN-WIRE ,GENERIC-WIRE>
           <TELL
"\"That's Monica's territory. I don't interfere.\"" CR>)
          (<EQUAL? .OBJ ,GENERIC-KEY>
           <TELL "\"Phong keeps the house keys for me.\"" CR>)
>ASK LINDER ABOUT WIRE
(Which wire do you mean, the white wire or the black wire?)

>WHITE
"Yes, Monica wired all the windows for burglars. With all modesty, I think she's
quite a mechanic."

>ASK LINDER ABOUT WIRE
(Which wire do you mean, the white wire or the black wire?)

>BLACK
"Yes, Monica wired the whole house for butler's buttons. With all modesty, I
think she's quite a mechanic."

>ASK LINDER ABOUT WIRE
(Which wire do you mean, the white wire or the black wire?)

>WIRE
"That's Monica's territory. I don't interfere."

>ASK LINDER ABOUT KEY
"I can't help you there."

>ASK LINDER ABOUT KEYS
"That has nothing to do with why I asked you here."

>ASK LINDER ABOUT SET
"Phong keeps the house keys for me."
eriktorbjorn commented 5 years ago

Judging by the output from the $DB command, these are two completely different problems. I don't know about the wire, and it seems like the least important of them anyway.

For the key, I get this:

>$DB
Find them bugs, boss!
[Room (M-END): Not handled]

>ASK LINDER ABOUT KEY
[Perform: 14/Mr. Linder/such thing]
[Not Here: [Moby-found 1 objects]
[Namely: set of house keys]
Not handled]
[detective=][Actor: Not handled]
[Room (M-BEG): Not handled]
[PRSI: Not handled]
[PRSO: "That has nothing to do with why I asked you here."
Handled]
[Room (M-END): Not handled]

>ASK LINDER ABOUT SET
[Perform: 14/Mr. Linder/such thing]
[Not Here: [Moby-found 3 objects]
[Generic: key]
Not handled]
[detective=][Actor: Not handled]
[Room (M-BEG): Not handled]
[PRSO: "Phong keeps the house keys for me."
Handled]
[Room (M-END): Not handled]

So that's interesting. The "Moby-found" stuff is in FIND-NOT-HERE. I guess what's happening is that MOBY-FIND only finds PHONG-KEYS for "KEY" and "KEYS", so no disambiguation is needed as far as it's concerned. I don't yet know why it doesn't also find CLOCK-KEY. I mean, I can understand why for "KEYS", but both objects should have "KEY" as synonym.

For "SET", it probably also picks up on the china and silver sets, in addition to the set of keys. It then uses the GENERIC property for disambiguation. Only PHONG-KEYS has it, so it calls GENERIC-KEY-F which determines that you meant GENERIC-KEY.

So the problem with the key boils down to: Why didn't it match the clock key?

eriktorbjorn commented 5 years ago

Ah. It's probably because CLOCK-KEY is invisible, and THIS-IT? excludes invisible objects.

It's probably worth noting that PHONG-F checks both for PHONG-KEYS and GENERIC-KEY:

          (<EQUAL? .OBJ ,GENERIC-KEY ,PHONG-KEYS>
           <COND (<IN? ,PHONG-KEYS ,PHONG>
              <TELL
"\"I have the keys for all the doors in the house.\"" CR>)
             (T
              <TELL
"\"Don't you remember? I gave you all the keys I have.\"" CR>)>)

So LINDER-F should probably do the same.

eriktorbjorn commented 5 years ago

The wire problem also affects asking Monica about it.

eriktorbjorn commented 5 years ago

The wire problem could have something to do with GENERIC-WIRE-F, since it's supposed to help the parser with disambiguation of wires.