For this week, we had to create an algorithm that can make something in our lives easier. I chose to write psuedocode that reflects the recipe of one of my cultural dishes, daal chawal (Lentil stew with basmati rice and pickled red onion.)
Here was my code:
Write a piece of code that you help perform a daily task more efficiently,
in particular, a task that involves a certain level of "repetition". Use
a programmatic logic to define the task and series of steps — this can be
just a few sentences.
Tip: Think of the examples from the lecture,
you can combine code and poetry; code and cooking recipes; code and choreography;
Also you can check further references in the resources below.
Remember to add this task to your blog, and add a short explanation
behind the making of this task. Also, add any relevant comments to the source code
file that helps better understand it. We will be sharing it in the next class.
DAAL CHAWAL
//Dis is how u make one of my cutural foods with code.
let pot = []
let riceCooker = []
let woodenSpoon;
let fryingPan[]
let bowl = []
let lentils
let cupWater
let garlic
let salt
let rice
let butter
let redChilli
let crushedChilli
let garamMasala
let tumericPowder
let corianderPowder
let cuminSeeds
let redOnion // no red onions for Dahlia ;]
let lemonJuice
function Daal{
potWater = cupWater*4
//lentils
pot.append(lentils, potWater)
//spices
pot.append(redChilli, crushedChilli, garamMasala, tumericPowder, corianderPowder, cuminSeeds)
Stir();
Rice();
Pickle();
time.sleep(1hr)
Stir();
Tarka();
bowl.append(Rice(),Daal(),Pickle());
}
function Rice{
riceWater = cupwater * 2
riceCooker.append[rice,riceWater,butter]
time.sleep(20m)
riceCooker[].warm
}
function Stir{
Pot.push(woodenSpoon);
time.sleep(10s)
Pot.pop;
}
function Tarka{
fryingPan.append[butter,garlic,cuminSeeds]
time.sleep(45s)
pot.append(fryingPan[])
}
function Pickle{
bowl.append(redOnion,salt)
time.sleep(10m)
bowl.wash()
bowl.append(lemonJuice)
}
Dahlia’s edit to my code was the comment ‘No red onions for Dahlia’ because she doesn’t like them!