A Processing code that randomly generates recipes for the least discerning of customers. Code written by Ben Brady and Jeremy Jih.
size (800,800);
background (255);
PFont font;
font = loadFont(“Helvetica-16.vlw”);
textFont(font);
textLeading(18);
fill(255, 0, 255);
String[] ingredients = { “bacon”, “sausage”, “chicken thighs”, “pork loin”, “eggs”, “sugar”, “salt”, “vinegar”, “oil”, “steak”,
“salmon”, “rice”, “halibut”, “gooseberry”, “flour”, “water”, “brown sugar”, “chocolate”, “peanut butter”, “pineapple”, “melon”,
“lettuce”, “strawberry”, “tomato”, “squash”, “zuccini”, “cucumber”, “cauliflower”, “brocolli”, “chili”, “lemon”, “milk”};
int index1 = int(random(ingredients.length));
String[] verbs = {“dice”, “peel”, “pound”, “marinate”, “defrost”, “grate”, “microwave” };
int index2 = int(random(verbs.length));
String[] processes = { “microwave”, “bake”, “baste”, “pan fry”, “deep fry”, “sautee”, “brown”, “stir”, “steam”, “broil”, “boil”, “grill” };
int index3 = int(random(processes.length));
String[] measures = { “one cup”, “one half cup”, “one quarter cup”, “two cups”, “one tablespoon”, “one teaspoon”, “one half teaspoon”, “one pound”, “thirteen pounds”};
int index4 = int(random(measures.length));
String[] poststate = { “to perfection”, “until golden brown”, “to taste”, “until crispy”, “until smooth”, “for ten minutes”, “for 5 minutes”, “for half an hour”, “for 24 hours”, “for 3 seconds”, “frenetically”, “manically”, “frantically”, “with rigor”, “with tenacity”};
int index5 = int(random(poststate.length));
String[] poststate2 = { “to perfection”, “until golden brown”, “to taste”, “until crispy”, “until smooth”, “for ten minutes”, “for 5 minutes”, “for half an hour”, “for 24 hours”, “for 3 seconds”, “frenetically”, “manically”, “frantically”, “with rigor”, “with tenacity”};
int index6 = int(random(poststate2.length));
String[] repeat = { “repeat as necessary”, “repeat as desired”, “repeat ad nauseaum”, “chill for 10 minutes”};
int index7 = int(random(repeat.length));
String[] combine = { “combine with”, “add to”, “pour into”, “stack on top of”, “subtract from”, “mix into”, “blend with”, “bathe in”};
int index8 = int(random(combine.length));
String[] ingredients2 = { “bacon”, “sausage”, “chicken thighs”, “pork loin”, “eggs”, “sugar”, “salt”, “vinegar”, “oil”, “steak”,
“salmon”, “rice”, “halibut”, “gooseberry”, “flour”, “water”, “brown sugar”, “chocolate”, “peanut butter”, “pineapple”, “melon”,
“lettuce”, “strawberry”, “tomato”, “squash”, “zuccini”, “cucumber”, “cauliflower”, “brocolli”, “chili”, “lemon”, “milk”};
int index9 = int(random(ingredients2.length));
String phrase = verbs[index2] + ” ” + measures[index4] + ” ” + ingredients[index1] + ” ” + poststate[index5] + “. ” + processes[index3] + ” ” + poststate2[index6] + “. ” + repeat[index7] + “. ” + combine[index8] + ” ” + ingredients2[index9];
println(phrase);
for(int i=0; i<4; i++){
String[] ingredientsB = { “bacon”, “sausage”, “chicken thighs”, “pork loin”, “eggs”, “sugar”, “salt”, “vinegar”, “oil”, “steak”,
“salmon”, “rice”, “halibut”, “gooseberry”, “flour”, “water”, “brown sugar”, “chocolate”, “peanut butter”, “pineapple”, “melon”,
“lettuce”, “strawberry”, “tomato”, “squash”, “zuccini”, “cucumber”, “cauliflower”, “brocolli”, “chili”, “lemon”, “milk”};
int index1B = int(random(ingredientsB.length));
String[] verbsB = {“dice”, “peel”, “pound”, “marinate”, “defrost”, “grate”, “microwave” };
int index2B = int(random(verbsB.length));
String[] processesB = { “microwave”, “bake”, “baste”, “pan fry”, “deep fry”, “sautee”, “brown”, “stir”, “steam”, “broil”, “boil”, “grill” };
int index3B = int(random(processesB.length));
String[] measuresB = { “one cup”, “one half cup”, “one quarter cup”, “two cups”, “one tablespoon”, “one teaspoon”, “one half teaspoon”, “one pound”, “thirteen pounds”};
int index4B = int(random(measuresB.length));
String[] poststateB = { “to perfection”, “until golden brown”, “to taste”, “until crispy”, “until smooth”, “for ten minutes”, “for 5 minutes”, “for half an hour”, “for 24 hours”, “for 3 seconds”, “frenetically”, “manically”, “frantically”, “with rigor”, “with tenacity”};
int index5B = int(random(poststateB.length));
String[] poststate2B = { “to perfection”, “until golden brown”, “to taste”, “until crispy”, “until smooth”, “for ten minutes”, “for 5 minutes”, “for half an hour”, “for 24 hours”, “for 3 seconds”, “frenetically”, “manically”, “frantically”, “with rigor”, “with tenacity”};
int index6B = int(random(poststate2B.length));
String[] repeatB = { “repeat as necessary”, “repeat as desired”, “repeat ad nauseaum”, “chill for 10 minutes”};
int index7B = int(random(repeatB.length));
String[] combineB = { “combine with”, “add to”, “pour into”, “stack on top of”, “subtract from”, “mix into”, “blend with”, “bathe in”};
int index8B = int(random(combineB.length));
String[] ingredients2B = { “bacon”, “sausage”, “chicken thighs”, “pork loin”, “eggs”, “sugar”, “salt”, “vinegar”, “oil”, “steak”,
“salmon”, “rice”, “halibut”, “gooseberry”, “flour”, “water”, “brown sugar”, “chocolate”, “peanut butter”, “pineapple”, “melon”,
“lettuce”, “strawberry”, “tomato”, “squash”, “zuccini”, “cucumber”, “cauliflower”, “brocolli”, “chili”, “lemon”, “milk”};
int index9B = int(random(ingredients2.length));
int y = 16 * i;
String phraseB = verbsB[index2B] + ” ” + poststateB[index5B] + “. ” + processesB[index3B] + ” ” + poststate2B[index6B] + “. ” + repeatB[index7B] + “. ” + combineB[index8B] + ” ” + ingredients2B[index9B];
println(phraseB);
textLeading (18);
text (phrase, 0,40);
text (phraseB, 0, 56 + y);
}
some sample recipes:
-grate one half cup lemon for 5 minutes. deep fry frantically. repeat as necessary. pour into water
-pound to taste. grill until crispy. repeat as desired. bathe in brown sugar
-defrost frenetically. deep fry for 5 minutes. repeat as necessary. bathe in squash
-peel with tenacity. grill for half an hour. repeat as desired. bathe in cauliflower
-grate with tenacity. microwave manically. repeat as desired. blend with gooseberry
-or-
-defrost two cups halibut manically. boil to perfection. repeat ad nauseaum. mix into chicken thighs
-pound for 5 minutes. pan fry until crispy. chill for 10 minutes. stack on top of strawberry
-dice until crispy. broil with tenacity. repeat as desired. blend with lettuce
-marinate for half an hour. boil with tenacity. chill for 10 minutes. subtract from rice
-marinate frenetically. grill with tenacity. chill for 10 minutes. pour into vinegar
Bon Appetit!
grate one half cup lemon for 5 minutes. deep fry frantically. repeat as necessary. pour into water
pound to taste. grill until crispy. repeat as desired. bathe in brown sugar
defrost frenetically. deep fry for 5 minutes. repeat as necessary. bathe in squash
peel with tenacity. grill for half an hour. repeat as desired. bathe in cauliflower
grate with tenacity. microwave manically. repeat as desired. blend with gooseberry
Filed under: Uncategorized