Assignment 4: NYUAD Cookbook

Concept

The other day I was wandering around Daymart with my friend who was trying to pick ingredients to cook soup. Looking at other people in the store, I noticed that some products are more popular than others, so I decided to create a humorous (anti) cookbook. When the reader clicks the mouse, a new recipe is generated with three random ingredients and two random actions from the lists that I have created.  The generated recipe is always absurd, and a funny image on the right complements this vibe.

Disclaimer: do not attempt cooking anything according to the recipe from this cookbook.

Highlight of the code I am proud of

Although the idea is not very complex, I have tried adding something that was not included into any of my works before – an image. It took some time, because I did not know that two preload() cannot exist in the same code since one will overpower another. I was moving the image preload to different segments of the code for a while, but then I have managed to figure out how to solve the issue.

function preload(){
  // loading text from the file
  strings = loadStrings("words.csv"); 
  // loading image
  img = loadImage('cookbook.jpg');
}

Sketch

Reflection

I am satisfied with the final result because it does make the user smile when reading all the generated recipes. One thing I would want to add is a similar method of randomising the image on the second page – instead of a single photo, it could be an actual illustration of the recipe. I am not sure how to do this yet, but I guess that several images would have to be linked to specific items from the lists in order to create an actual representation of the dish.

Leave a Reply