Removing the owner of a part from the printed name

Some example code:

A body is a kind of thing. A body is a part of every person.
A bodypart is a kind of thing.
A head is a kind of bodypart. A head is a part of every body.
An arm is a kind of bodypart. Two arms are a part of every body.
A leg is a kind of bodypart. Two legs are a part of every body.

The Woods is a room. The Black Knight is a man in the Woods. King Arthur is a man in the Woods.
Instead of examining a person (called p):
	let b be the list of things part of the noun;
	say "He has [b] still attached."

Examining the Knight (for example) results in “He has The Black Night’s body’s head…” etc. My desire is to replace “The Black Night’s body’s head” part with just, say, “a head.” Anybody able to help?

Side note: Inform throws a fit with me if I leave out the “let” and just use “say ‘He has [a list of things part of the noun].’” for some reason.

1 Like

Tweaking the printed names of the various objects is probably the way to do this, though there are a couple of odd things about your implementation that you might eventually need to change – if the two legs and arms are interchangeable, this will lead to ugly descriptions and potential bugs, so you might want right and left versions of each, for one thing. I’m also not sure you need the body as a separate thing, to which the various limbs are attached – as written, right now your code just would name the body when examining a person, since everything else is a part of the body. The “enclosed by” relation should help with that, though.

Anyway, making some assumptions about what behavior you’re looking for, does something like this work?

A body is a kind of thing. A body is a part of every person.
A bodypart is a kind of thing.
A head is a kind of bodypart. A head is a part of every body.
An arm is a kind of bodypart. Two arms are a part of every body.
A leg is a kind of bodypart. Two legs are a part of every body.

The printed name of a head is usually "a head".  The printed name of an arm is usually "an arm".  The printed name of a leg is usually "a leg".

The Woods is a room. The Black Knight is a man in the Woods. King Arthur is a man in the Woods.
Instead of examining a person (called p):
	let b be the list of bodyparts enclosed by p;
	say "He has [b] still attached."
1 Like

Oh, good grief! Yes. Figures I was trying to make things WAY more complicated than they needed to be! :sweat_smile:

1 Like