Skip to content

Instantly share code, notes, and snippets.

@geokavel
Last active August 31, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geokavel/c8b5ed4a8655a0ed7aba16b8153b125c to your computer and use it in GitHub Desktop.
Save geokavel/c8b5ed4a8655a0ed7aba16b8153b125c to your computer and use it in GitHub Desktop.
Beginning of solution to https://codegolf.stackexchange.com/questions/141109/cooking-with-code. Puts inputs into mixing bowls.
Cooking with Code.
This works in the perl interpreter.
Input: Chef only takes numerical input. All inputs are new-line separated.
Input a bunch of numbers representing your ingredients. Then input '0'.
Then input some more numbers that represent each spice you use. Then input '0'.
This program puts the ingredients in the 1st mixing bowl, the actions in the 2nd mixing bowl
(with a '0' at the bottom), and a copy of the ingredients in the 3rd.
The variable "ingredients" stores the number of different ingredients you have.
Ingredients.
1 g spices
0 g ingredients
0 g order
1 g actions
1 g one
Method.
Get the spices.
Take spices from refrigerator.
Put spices into mixing bowl.
Put spices into 3rd mixing bowl.
Get the ingredients until geted.
Remove one from mixing bowl.
Remove ingredients from mixing bowl.
Fold ingredients into mixing bowl.
Put ingredients into mixing bowl.
Remove one from mixing bowl.
Fold order into mixing bowl.
Fold spices into 3rd mixing bowl.
Reverse the order.
Stir order into mixing bowl.
Stir order into 3rd mixing bowl.
Reverse the order until reversed.
Find the actions.
Take actions from refrigerator.
Put actions into 2nd mixing bowl.
Stir ingredients into 2nd mixing bowl.
Find until finded.
Pour contents of the mixing bowl into the baking dish.
Pour contents of the 2nd mixing bowl into the 2nd baking dish.
Pour contents of the 3rd mixing bowl into the 3rd baking dish.
Refrigerate for 3 hours.
@geokavel
Copy link
Author

I fixed the order so the first spices/actions you input will be at the top of the stack (mixing bowl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment