1// ๐งช BREW STATE โ what the cauldron remembers
2var color = 'purple', stirs = 0, done = false;
3
4// โฐ setTimeout โ runs ONCE after a delay (auto, no tap!)
5setTimeout(function() {
6 potion.color = 'purple';
7 done = true; // โ
brew complete!
8}, 2000); // โณ wait N ms
9
10// ๐ setInterval โ repeats on a schedule
11var stirLoop = setInterval(function() {
12 stir(); // ๐ stir the cauldron!
13 stirs++; // count each stir
14 if (stirs >= 4) clearInterval(stirLoop); // ๐ stop!
15}, 800); // โฑ every N ms