Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

six-pack problem

0 views
Skip to first unread message

wabbyt

unread,
May 12, 2008, 6:59:16 AM5/12/08
to
Hi,

I am testing out inform 7 and have made some progress trying the
examples in the documentation. Now I want to create my own game and
got stuck by the refrigerator ;)

In there I want a six-pack of beer and a bottle of whine. This I've
done. But I also want the player to be able to take 1-6 beers from the
pack and drink it/them and the description of the beerpack to change
accordingly.
About the wine the problem is similar. The player shouldn't have to
empty the whole whine-bottle, but rather pour glasses of whine until
the bottle is empty.

First I thought about having some counter property - but the inform
language is so elegant so I think there must be a more elegant
solution.

Thanks for any input on this.
/wabbyt

hari...@gmail.com

unread,
May 12, 2008, 8:53:07 AM5/12/08
to
On May 12, 6:59 am, wabbyt <nos...@screentan.org> wrote:
> In there I want a six-pack of beer and a bottle of whine. This I've
> done. But I also want the player to be able to take 1-6 beers from the
> pack and drink it/them and the description of the beerpack to change
> accordingly.

Firstly, you have to decide if it's a really important interaction to
"take beer from six-pack", or if you just want to have "get beer" work
as expected. If it's the latter, I might not model a six-pack object
at all, but have the fridge know how to naturally describe how many
beers remain in the fridge. Also, will you want to model all six cans
individually or constrain the game so only one beer is "active" until
consumed. If you want to stack cans on the counter or collect deposit
change from them, you may need six cans.

Secondly, are you making a wry pun or just accidentally spelling
"wine"
with an extra H?

Al

unread,
May 12, 2008, 8:57:42 AM5/12/08
to
Here's some beginning code

but there are some logic errors in it.
I'll try to correct them and post later but its a start.

<code>
Liquor Store is a room.
"You are in your favorite liquor store."

a open container called a six-pack is in the liquor store.
the printed name is "six-pack of beer".
the description is "This is a 6-pack of beer which has [remaining]
cans left.".
understand "6-pack" or "pack" as the six-pack.
the six-pack has a number called remaining.
the remaining of the six-pack is 6.

a closed openable container called a wine bottle is in the store.

the wine bottle has a number called pours.
the pours of the wine bottle is 3.

pouring is an action applying to one thing.
understand "pour [something]" as pouring

instead of pouring the wine bottle when the pours of the wine bottle
is not 0:
decrease the pours of the wine bottle by 1;
say " You pour some wine out of the bottle."

check pouring the wine bottle:
if the pours of the wine bottle is 0,
say "The bottle is empty.".

the description of the bottle is
" A bottle of Thunderbird.".

a can is a kind of container.
a can is always openable.
a can is usually closed.
understand "beer" as the can.
6 cans are in the six-pack.

instead of drinking the can when the can is closed,
say "You need to open the can first.".

instead of drinking the can:
move a random can to the player;
decrease the remaining of the six-pack by 1;
say "You drink the beer. You have [remaining of the six-pack] cans of
beer left.".

<code>


Emiliano 'Inform Ninja' Short

unread,
May 12, 2008, 9:15:17 AM5/12/08
to
OK, I didn't bother with the wine. Here's the six-pack though. What
silliness.


"Beer Fridge" by "Emiliano Short"

The kitchen is a room.

The fridge is a container in the kitchen. Understand "refrigerator"
as the fridge.
The fridge is closed and openable.
Instead of taking the fridge, say "It's a big [']un. You'll need some
help to shift it far."

A six-pack is a container in the fridge. Understand "pack" or "6-
pack", "piece/bit of plastic", "plastic", "depleted six-pack", "pair/
trio of beers", "trio/pair" as the six-pack. The description is "The
six-pack is, as you might expect, a piece of plastic forming six
rings, each of which ensnares the top of a can of beer, just as it
will no doubt ensnare some unsuspecting wildlife around the neck when
it is eventually discarded in a landfill site."
Rule for printing the name of the six-pack:
omit contents in listing;
continue the action.

A can of beer is a kind of thing. The plural of can of beer is cans of
beer.
Understand "beer can", "cold one/beer/can" as a can of beer.
Six cans of beer are in the six-pack. The description is "The beer
appears to be from an obscure Slovakian brewery, as far as you can
tell from the can."

Instead of drinking a can of beer:
say "You pour the ale down your throat and toss the empty can out the
window.";
remove the noun from play.

Every turn when in the kitchen:
if exactly six cans of beer are in the six-pack begin;
say "You're itching to get your hands on a nice cold one.";
otherwise if exactly five cans of beer are in the six-pack;
change the printed name of the six-pack to "deflowered six-pack";
omit contents in listing;
change the description of the six-pack to
"The six-pack is a piece of plastic uniting six cans, or at least it
was before you took one.";
otherwise if exactly four cans of beer are in the six-pack;
change the printed name of the six-pack to "depleted six-pack";
change the description of the six-pack to
"Two gaping rings of plastic mar the sublime beauty of the cold six-
pack.";
otherwise if exactly three cans of beer are in the six-pack;
change the printed name of the six-pack to "trio of beers";
change the description of the six-pack to
"This is but half a six-pack. A sad thing indeed.";
otherwise if exactly two cans of beer are in the six-pack;
change the printed name of the six-pack to "pair of beers";
change the description of the six-pack to
"Two cans of beer hang in a lonely and dejected fashion from the bit
of plastic, like the testicles of some forgotten pensioner.";
otherwise if exactly one can of beer is in the six-pack;
change the printed name of the six-pack to "can of beer with a bit
of plastic on";
change the description of the six-pack to
"Your six-pack is now but a memory, just as your metaphorical one is
but a vague ambition.[paragraph break]In concrete terms, this is a can
of beer with an unsightly bit of plastic dangling from it.";
otherwise;
change the printed name of the six-pack to "bit of plastic";
change the description of the six-pack to
"It's just a piece of plastic.";
end if.

Instead of inserting a can of beer into a six-pack: say "The damn ring
won't go back over the lip of the can. It just slips off. These
things are not supposed to be put back."

dott.Piergiorgio

unread,
May 12, 2008, 9:16:34 AM5/12/08
to
hari...@gmail.com ha scritto:

> Secondly, are you making a wry pun or just accidentally spelling
> "wine"
> with an extra H?

Indeed I was thinking about some puns/jokes about whining around a glass
od wine.... ;)

hmmmm.... now that we're around letter in excess, someone has ever tried
to implement in current IF languages the "T-removing machine" ? ;)

Best regards from Italy,
Dott. Piergiorgio.

hari...@gmail.com

unread,
May 12, 2008, 9:56:53 AM5/12/08
to
On May 12, 9:16 am, "dott.Piergiorgio"

<dott.PiergiorgioNI...@KAIGUN.fastwebnet.it> wrote:
> hmmmm.... now that we're around letter in excess, someone has ever tried
> to implement in current IF languages the "T-removing machine" ? ;)

No, but it would be fairly simple. Make a table of things and their t-
less form.

Table of Removed Tees
With Tee Without Tee
tangle angle
planet plane
twig wig
vista visa
train rain
... ...
bunny priest

wabbyt

unread,
May 12, 2008, 10:40:26 AM5/12/08
to
(accidently answered as a new post... so this is an attempt to correct
this... so sorry for the double-posting).

Thank you Al and Emiliano. I learned a lot from your code.
hari: no, it was just a stupid misspelling. English is not my native
language and though I understand it quite well my spelling needs
practice (or a spell-check).
And, yes... for my idea of the game it is important to make a six-pack
six individual bottles of beer. I'm trying to construct a game that
(as closly as I can) imitates a kind of "real life" where your
girlfriends mood changes quite a bit whether you've drunk one or six
beers (emptied the cat-litter, wore your shoes inside, vacuumed ...
and so on).

emiliano: the "instead of taking the fridge"-line. Are there benefits
there over making the fridge scenery or fixed in place?

Thank you again for very usefull information.

/wabbyt

Emiliano 'Inform Ninja' Short

unread,
May 13, 2008, 1:02:45 AM5/13/08
to
On May 13, 12:40 am, wabbyt <nos...@screentan.org> wrote:
>
> emiliano: the "instead of taking the fridge"-line. Are there benefits
> there over making the fridge scenery or fixed in place?
>
> Thank you again for very usefull information.

Well, making it scenery has too effects: it makes it fixed in place
and it stops it being mentioned after the room description. I assume
you want it to be mentioned.

Simply making it fixed in place would work fine, but it would print
the boring "That seems to be fixed in place" message. "Instead of
taking the fridge" allows you to insert a more interesting response.
After all, the fridge is not actually fixed in place; it's just very
heavy.

For thoroughness, you could choose to make it fixed in place, and also
include the "instead of" text. But it wouldn't actually make any
difference to the above game.

My code could be improved a bit. For example, when there is only one
can left, taking the can should logically result in taking the whole
"six-pack" (i.e. the can and the bit of plastic on top). To separate
them at that stage, it would be more logical to remove the plastic
than the can. But you get the general idea.

0 new messages