It says in the recipe that I need 60g of sugar but I don't have a kitchen scale (I use a measuring cup).
The problem is that I only have sugar cubes, I can't use a measuring cup with that. After fiddling with the idea of pounding sugar cubes into powdered sugar, I reckoned that, knowing the weight of the sugar box, I could use some math tricks to compute how many sugar cubes I needed. (I f*ing love science!)
I made an app that you can use if you ever find yourself in the same situation. What's terrific about this app is that it doesn't matter if you use the metric or imperial system of units, it will work the same!
(use-modules (ice-9 readline))
(use-modules (ice-9 format))
(let* ((x (string->number (readline "What's the length of your box (in sugar cubes) ")))
(y (string->number (readline "What's the width of your box? (in sugar cubes) ")))
(z (string->number (readline "What's the height of your box? (in sugar cubes) ")))
(w (string->number (readline "What's the weight of your sugar box? (in units of weigth) ")))
(q (string->number (readline "How much sugar do you need? (in units of weight) ")))
(n (ceiling (/ (* x y z q) w)))) ; more sugar is better
(format #t "You need ~r cubes of sugars.\nBon appetit!\n" n))
Typical session:
$ guile sugarhack.scm
What's the length of your box (in sugar cubes) 14
What's the width of your box? (in sugar cubes) 4
What's the height of your box? (in sugar cubes) 4
What's the weight of your sugar box? (in units of weigth) 1000
How much sugar do you need? (in units of weight) 60
You need fourteen cubes of sugars
Bon Appetit!