printing plural items within a container

So printing the plural name of something is a completely different activity than printing the name of it. You can write rules for after printing the plural name of something, just like printing the name of it.

After printing the plural name of an arrow:
	say " (1lbs each)";

garden
You can see eleven arrows (1lbs each), a chest (in which are a rock and a box (empty)) and a ball here.

If your listed properties don’t rely on the exact number of, say, arrows present or you’re willing to work with this kind of output then you might be good to go with that.

EDIT: Hah! Dug up a way to grab the number of arrows:

After printing the plural name of an arrow:
	say " ([listing group size]lbs)";

You can see eleven arrows (11lbs)

I was messing around with the grouping activity for a bit, but this thread made me realize that listing group size is also set for this kind of automatic grouping! “Listing group size” should be very helpful for you if you need to list any values dependent on how many of them there are (like weight and possibly cost).

1 Like