# mixing bowl problem

[Edit: Inform 7!]
I’m hoping you all can point me toward the right parts of the documentation or exemplars to find the right syntax for these two problems. I’m very new, but making good progress on my first real game.

I want my player to make bread dough. I have things in the room: a mixing bowl, a pinch of salt, olive oil, water, and flour.

Problem 1. If the player tries to put anything in the mixing bowl besides the correct ingredients, I want her to be told “That isn’t going to get the bread baked.”

But I don’t know how to code something like “Before putting any thing into the mixing bowl: If that thing is not A, B, C, D, say ‘That isn’t going to get the bread baked!’; if that thing is A, B, C, D, continue the action.” Or similar.

Problem 2. When the mixing bowl contains all four ingredients, I want to alert the player “Now you can start mixing up a dough!”

But I don’t know how to code something like "After putting a thing in the mixing bowl: If the mixing bowl contains A, B, C, and D, say “Now you can start mixing up a dough!”

There might be better ways than what I’m trying. Any pointers toward the right syntax for what I’m trying, or toward a better way to think about it?

Thanks! Brooke

Creating new kinds is one way to handle something like this.

[code]Kitchen is a room.

An ingredient is a kind of thing.

The pinch of salt is an ingredient, in the Kitchen.
The olive oil is an ingredient, in the Kitchen.
The water is an ingredient, in the Kitchen.
The flour is an ingredient, in the Kitchen.

The spoon is in the Kitchen.
The oven mitt is in the Kitchen.

The mixing bowl is an open container in the Kitchen.

Instead of inserting something which is not an ingredient into the mixing bowl:
say “That isn’t going to get the bread baked!”

After inserting an ingredient into the mixing bowl:
if the mixing bowl contains four ingredients, say “Now you can start mixing up a dough!”;
otherwise continue the action.
[/code]

This example has a few limitations: it assumes that there will only be four ingredients, and that bread is the only thing you can make with them. But it should get you started.

A couple of additions to Mike’s post:

If you don’t want to count the number of ingredients, you can write “if the mixing bowl contains every ingredient” (or “If every ingredient is in the mixing bowl”).

Also, using an “After” rule will cut off the normal rule that reports putting the ingredient into the bowl. If you don’t like that, you can make an every turn rule to check if everything is in there, like this:

```Every turn when the mixing bowl contains every ingredient: say "Now you can start mixing up a dough!```

Then when you put the last ingredient in, you get the message “You put the flour into the mixing bowl” before the message that you’re ready to start mixing it up.

Thanks to you both! I’ve tested it, and it’s working well. (Whether as “four ingredients” and “every ingredient”.) Matt, the Every-turn rule is a nice addition, thanks.

I was able to add a nice touch that I’m proud of. To save the player the trouble of mixing the ingredients into dough (she has other puzzles to worry about), I created “Dough” as a thing in the world, and modified Mike’s “After” statement like so:

``````After inserting an ingredient into the mixing bowl:
if the mixing bowl contains four ingredient:
say "We're getting somewhere now! You mix the ingredients with your hands until you have a good dough.";
now every ingredient is nowhere;
now dough is in the mixing bowl;
otherwise:
continue the action.``````

Works great! Thanks again to you both.

Brooke

Nice touch!