Open eriktorbjorn opened 5 years ago
I think I've looked through all the uses of RANDOM-ELEMENT
and PICK-ONE
in the Zork games and substrate, and apart from this the only other incorrect usage I could find is already covered by https://github.com/the-infocom-files/zork2/issues/8
That message is printed by
PLID-FCN
:RANDOM-ELEMENT
is defined in zork-substrate:And so is
DUMMY
It's an
LTABLE
, meaning that the first element is the length of the table. In addition, the first visible element is a 0, and that's probably what got picked in the above example. This type of tables is meant to be used withPICK-ONE
which uses the first element for some kind of bookkeeping. (I think it has to do with avoiding the same element getting picked twice in a row, or something like that.)Zork I uses
PICK-ONE
whenever it usesDUMMY
. Zork III doesn't useDUMMY
at all. Zork II always usesRANDOM-ELEMENT
, which is wrong. It does so inOPEN-CLOSE
(twice) and the aforementionedPLID-FCN
.