Chef is a programming language where your programs look like a recipe!
You can have measures like cups and tablespoons, use liquid ingredients (output as unicode characters) while dry or unspecified will output numerics, to be put on a mixing bowl (which acts like a stack) or a baking dish!
The recipe starts with a title of the dish, which is a short description of what the program does.
Next we have the ingredients, which represent the variable declarations. Next, the method, that contains the real recipe instructions, like "take ingredient from refrigerator" which means to read a numeric from an input.
Check on DangerMouse for the language specification.
Here is the "Hello World Souffle" example:
Hello World Souffle.
This recipe prints the immortal words "Hello world!", in a basically brute force way. It also makes a lot of food for one person.
Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes
Method.
Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the mixing bowl into the baking dish.
Serves 1.
No comments:
Post a Comment