Discussions about interactive fiction

I7: Collective Names

For complicated and somewhat tricky reasons, I was finding it difficult
to implement three colored jellybeans using a value called bean-color.
Namely, because they were indistinguishable, I7 would list them to the
player as "three jellybeans" without mentioning that one was pink, one
purple, and one yellow.

So instead I just made three separate objects that happen to share the
noun "jellybean."

Trouble is, the player can’t use "beans" to refer to them collectively.

So how would I do it? My first attempt (now discarded) looked like this:

[code]
Bean-color is a kind of value. The bean-colors are pink, purple, and yellow.

A jellybean is a kind of thing. A jellybean has a bean-color. The
bean-color of a jellybean is usually purple. The printed name of a
jellybean is "[bean-color] jellybean". Understand "beans" as the jellybeans.

One pink jellybean is in the big glass jar. One purple jellybean is in
the big glass jar. One yellow jellybean is in the big glass jar.
[/code]

But when I do that, a list of the jellybeans doesn’t print them out by
their separate colors. It also doesn’t cause "beans" to refer to the
group. The command ‘take beans’ still takes one bean at random, not the
group.

The documentation on this subject seems a bit thin and scattered. Is
there one place where I can learn EVERYTHING there is to know about
groups of similar objects?

How can I make "beans" refer to several simultaneous objects, (a) when
they’re all of a single author-defined kind, and (b) when they’re just
simple objects?

–Jim Aikin

.
posted by admin in Uncategorized and have Comments (2)

2 Responses to “I7: Collective Names”

  1. admin says:

    - Hide quoted text — Show quoted text -

    Jim Aikin wrote:
    > For complicated and somewhat tricky reasons, I was finding it difficult
    > to implement three colored jellybeans using a value called bean-color.
    > Namely, because they were indistinguishable, I7 would list them to the
    > player as "three jellybeans" without mentioning that one was pink, one
    > purple, and one yellow.

    > So instead I just made three separate objects that happen to share the
    > noun "jellybean."

    > Trouble is, the player can’t use "beans" to refer to them collectively.

    > So how would I do it? My first attempt (now discarded) looked like this:

    > [code]
    > Bean-color is a kind of value. The bean-colors are pink, purple, and
    > yellow.

    > A jellybean is a kind of thing. A jellybean has a bean-color. The
    > bean-color of a jellybean is usually purple. The printed name of a
    > jellybean is "[bean-color] jellybean". Understand "beans" as the
    > jellybeans.

    > One pink jellybean is in the big glass jar. One purple jellybean is in
    > the big glass jar. One yellow jellybean is in the big glass jar.
    > [/code]

    > But when I do that, a list of the jellybeans doesn’t print them out by
    > their separate colors. It also doesn’t cause "beans" to refer to the
    > group. The command ‘take beans’ still takes one bean at random, not the
    > group.

    > The documentation on this subject seems a bit thin and scattered. Is
    > there one place where I can learn EVERYTHING there is to know about
    > groups of similar objects?

    > How can I make "beans" refer to several simultaneous objects, (a) when
    > they’re all of a single author-defined kind, and (b) when they’re just
    > simple objects?

    > –Jim Aikin

    Make them three unique instances of one kind. The only trick is allowing
    them to be referred in groups (see 16.8. Understanding names).

    [code]
    A bean is a kind of thing. Understand "bean" as a bean.
    Understand "beans" as the plural of a bean. [ch 16.8]

    The Lab is a room. The big glass jar is an open transparent container in
    the lab.

    The pink jellybean, the purple jellybean, and the yellow jellybean are
    beans in the big glass jar.

    test me with "get beans / put two beans in jar / get bean from jar /
    purple / get bean from jar".
    [/code]

    Skinny Mike

  2. admin says:

    Yes, I can see that making them unique instances (rather than
    indistinguishable instances) may work. I’ll try it.

    I’m wondering, also … ‘jellybean’ is nine letters long. Is the parser
    going to be able to distinguish between ‘jellybean’ and ‘jellybeans’?
    Because it pretty much has to, for this puzzle to work. How do I set
    that up?

    –JA

    - Hide quoted text — Show quoted text -

    Mike Tarbert wrote:
    > Jim Aikin wrote:
    >> For complicated and somewhat tricky reasons, I was finding it
    >> difficult to implement three colored jellybeans using a value called
    >> bean-color. Namely, because they were indistinguishable, I7 would list
    >> them to the player as "three jellybeans" without mentioning that one
    >> was pink, one purple, and one yellow.

    >> So instead I just made three separate objects that happen to share the
    >> noun "jellybean."

    >> Trouble is, the player can’t use "beans" to refer to them collectively.

    >> So how would I do it? My first attempt (now discarded) looked like this:

    >> [code]
    >> Bean-color is a kind of value. The bean-colors are pink, purple, and
    >> yellow.

    >> A jellybean is a kind of thing. A jellybean has a bean-color. The
    >> bean-color of a jellybean is usually purple. The printed name of a
    >> jellybean is "[bean-color] jellybean". Understand "beans" as the
    >> jellybeans.

    >> One pink jellybean is in the big glass jar. One purple jellybean is in
    >> the big glass jar. One yellow jellybean is in the big glass jar.
    >> [/code]

    >> But when I do that, a list of the jellybeans doesn’t print them out by
    >> their separate colors. It also doesn’t cause "beans" to refer to the
    >> group. The command ‘take beans’ still takes one bean at random, not
    >> the group.

    >> The documentation on this subject seems a bit thin and scattered. Is
    >> there one place where I can learn EVERYTHING there is to know about
    >> groups of similar objects?

    >> How can I make "beans" refer to several simultaneous objects, (a) when
    >> they’re all of a single author-defined kind, and (b) when they’re just
    >> simple objects?

    >> –Jim Aikin

    > Make them three unique instances of one kind. The only trick is allowing
    > them to be referred in groups (see 16.8. Understanding names).

    > [code]
    > A bean is a kind of thing. Understand "bean" as a bean.
    > Understand "beans" as the plural of a bean. [ch 16.8]

    > The Lab is a room. The big glass jar is an open transparent container in
    > the lab.

    > The pink jellybean, the purple jellybean, and the yellow jellybean are
    > beans in the big glass jar.

    > test me with "get beans / put two beans in jar / get bean from jar /
    > purple / get bean from jar".
    > [/code]

    > Skinny Mike

Place your comment

You must be logged in to post a comment.