Open wraybowling opened 3 years ago
I think before doing recursion, is there a way to denote which ingredients don’t scale?
for instance, red pepper flakes in a pasta sauce cause spice to grow exponentially. Maybe just add like 25% more?
sometimes ingredients are just there to catalyze. Like when poaching an egg, you just need a little bit of baking soda or vinegar to make the pH of the water different from the egg long enough that the egg white maintains cohesion long enough to cook. When you poach a 100 eggs, the water doesn’t need to be acidic enough to depolarize water.
Without recursion involved I could argue that these are two separate new issues.
Some recipes need ingredients that in turn have their own recipe. I've been trying to decide a way to handle this for years. It's time to actually track my progress...
There's a simple way and a really complicated way. Right now I'm leaning towards a simple way because every time I think about the complicated way I make no progress. So. Here's my idea:
Currently, a regular ingredient can be written as
"ingredient": 123
where the value is always number. For recursion, I think the simplest solution would be to assign the value as an object. Ingredients within that object could be checked against the master list to find recipes that have multiple uses. For example"Hollandaise" : { "Hollandaise" : 123 }
But this would also allow the flexibility of defining sub-recipes, e.g. "steps", that will not have any use in the master list such as a specific dipping sauce like so"garlic soy": {"soy sauce": 29, "garlic": 29}
. Note that the values must match the parent's portion size in that case. And of course, these effects would be able to combine. The most notable example is of course aiole. All aiole is just mayonnaise + something else but that means that if one of the ingredients comes in oil like anchovies you may as well build the mayonnaise itself using the oil the fish came in.Which would initially render as:
500
Romaine Lettuce208
Ceasar Dressing 🔽23
Anchovies155
Mayonnaise ▶10
Mustard10
Worcestershire10
Balsamic VinegarNote that the
208
is a computed value. It is the sum of the sub-recipe's parts.Note that the scalar for the mayo is
155/(52+5+108+3)
=0.9226190476
so that when Mayonnaise is expanded, the values from the initial recipe will be slightly smaller500
Romaine Lettuce208
Ceasar Dressing 🔽23
Anchovies155
Mayonnaise 🔽48
Room Temperature Egg Yolk5
Citric Acid (lemon)100
Oil (add slowly)3
Salt10
Mustard10
Worcestershire10
Balsamic VinegarRequirements:
1.0