Skip to content

Instantly share code, notes, and snippets.

@perey
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perey/d77af1e8518ff43df0c1 to your computer and use it in GitHub Desktop.
Save perey/d77af1e8518ff43df0c1 to your computer and use it in GitHub Desktop.
Chef code for converting improper fractions to mixed numbers.
Fraction Dosa.
This recipe takes a numerator and denominator from STDIN and outputs the
mixed-number representation to STDOUT.
Ingredients.
2 cups numerator rice
2 cups denominator ukda chawal
1 cup whole part urad dal
10 teaspoons new line poha
Method.
Clean 3rd mixing bowl.
Take numerator rice from refrigerator.
Take denominator ukda chawal from refrigerator.
Put denominator ukda chawal into 2nd mixing bowl.
Put numerator rice into 2nd mixing bowl.
Serve with Mixed Number Chutney.
Fold whole part urad dal into 1st mixing bowl.
Fold numerator rice into 1st mixing bowl.
Fold denominator ukda chawal into 1st mixing bowl.
Put denominator ukda chawal into 2nd mixing bowl.
Put numerator rice into 2nd mixing bowl.
Put whole part urad dal into 2nd mixing bowl.
Clean 1st mixing bowl.
Liquify new line poha.
Put new line poha into 1st mixing bowl.
Serve with Printed Fraction Sambar.
Pour contents of the 1st mixing bowl into the baking dish.
Serves 1.
Printed Fraction Sambar.
This recipe prepares the numeric quantity of an ingredient for output. It
takes the whole-number part, numerator, and denominator from the 2nd mixing
bowl, and puts the formatted values into the 1st mixing bowl.
Ingredients.
1 cup numerator lentils
47 ml solidus water
1 cup denominator vegetables
32 ml space tamarind pulp
1 cup whole part sambar masala
1 teaspoon unitary sugar
0 g space needed salt
Method.
Clean 1st mixing bowl.
Fold whole part sambar masala into 2nd mixing bowl.
Fold numerator lentils into 2nd mixing bowl.
Fold denominator vegetables into 2nd mixing bowl.
Wash the numerator lentils.
Put unitary sugar into 1st mixing bowl.
Fold space needed salt into 1st mixing bowl.
Put denominator vegetables into 2nd mixing bowl.
Serve with Int to String Lime Wedges.
Put solidus water into 1st mixing bowl.
Put numerator lentils into 2nd mixing bowl.
Serve with Int to String Lime Wedges.
Set aside.
Rinse until washed.
Powder the whole part sambar masala.
Dissolve the space needed salt.
Put space tamarind pulp into 1st mixing bowl.
Set aside.
Agitate until dissolved.
Put whole part sambar masala into 2nd mixing bowl.
Serve with Int to String Lime Wedges.
Set aside.
Grind until powdered.
Refrigerate.
Int to String Lime Wedges.
This recipe takes a non-negative integer from the 2nd bowl and puts the
corresponding string of numeric characters into the 1st bowl.
Ingredients.
1 integer lime
10 ml divisor lime juice
48 g ASCII sugar
0 g discard salt
Method.
Fold integer lime into 2nd mixing bowl.
Clean 1st mixing bowl.
Clean 2nd mixing bowl.
Clean the integer lime.
Slice the integer lime.
Put divisor lime juice into 2nd mixing bowl.
Put integer lime into 2nd mixing bowl.
Serve with Mixed Number Chutney.
Fold integer lime into 1st mixing bowl.
Stir the 1st mixing bowl for 1 minute.
Fold discard salt into 1st mixing bowl.
Add ASCII sugar into 1st mixing bowl.
Continue until sliced.
Liquify contents of the 1st mixing bowl.
Refrigerate.
Wash until cleaned.
Put ASCII sugar into 1st mixing bowl.
Liquify contents of the 1st mixing bowl.
Refrigerate.
Mixed Number Chutney.
This recipe converts a fraction to its mixed-number representation. It takes
a numerator and denominator (in that order) in the 2nd mixing bowl, and puts a
whole-number part, numerator and denominator into the 1st mixing bowl. This is
also usable as a positive-integer divmod recipe: the whole-number part is the
quotient, the numerator is the remainder, and the denominator can be ignored.
Ingredients.
1 cup numerator coconut
20 g denominator chana dal
1 teaspoon unitary chilli
5 g comparison result ginger
0 g null salt
Method.
Clean 1st mixing bowl.
Put null salt into 1st mixing bowl.
Fold numerator coconut into 2nd mixing bowl.
Fold denominator chana dal into 2nd mixing bowl.
Clean 2nd mixing bowl.
Put numerator coconut into 2nd mixing bowl.
Put denominator chana dal into 2nd mixing bowl.
Serve with Comparison Minted Yoghurt.
Remove unitary chilli from 1st mixing bowl.
Fold comparison result ginger into 1st mixing bowl.
Blend the comparison result ginger.
Put numerator coconut into 3rd mixing bowl.
Remove denominator chana dal from 3rd mixing bowl.
Fold numerator coconut into 3rd mixing bowl.
Add unitary chilli into 1st mixing bowl.
Clean 2nd mixing bowl.
Put numerator coconut into 2nd mixing bowl.
Put denominator chana dal into 2nd mixing bowl.
Serve with Comparison Minted Yoghurt.
Remove unitary chilli from 1st mixing bowl.
Fold comparison result ginger into 1st mixing bowl.
Shake until blended.
Put numerator coconut into 1st mixing bowl.
Stir the 1st mixing bowl for 2 minutes.
Put denominator chana dal into 1st mixing bowl.
Stir the 1st mixing bowl for 2 minutes.
Refrigerate.
Comparison Minted Yoghurt.
This recipe removes the top two numbers from the 2nd mixing bowl and compares
them. It puts the result into the 1st mixing bowl: 1 if the first is greater,
0 if they are equal, and -1 if the second is greater. It only works on
non-negative integers!
Ingredients.
200 g first value yoghurt
15 g second value mint
1 teaspoon unitary sugar
0 g comparison salt
Method.
Clean 1st mixing bowl.
Fold first value yoghurt into 2nd mixing bowl.
Fold second value mint into 2nd mixing bowl.
Warm the first value yoghurt.
Put second value mint into 3rd mixing bowl.
Serve with Logical Not Ghee.
Fold comparison salt into 1st mixing bowl.
Blend comparison salt.
Put unitary sugar into 1st mixing bowl.
Refrigerate.
Agitate until blended.
Clean 3rd mixing bowl.
Put second value mint into 3rd mixing bowl.
Remove unitary sugar from 3rd mixing bowl.
Fold second value mint into 3rd mixing bowl.
Heat the first value yoghurt until warmed.
Put unitary sugar into 1st mixing bowl.
Remove unitary sugar from 1st mixing bowl.
Smell the second value mint.
Remove unitary sugar from 1st mixing bowl.
Refrigerate.
Bruise until smelled.
Refrigerate.
Logical Not Ghee.
This recipe inverts the value on top of the 3rd mixing bowl: it returns a 0 if
it is non-zero, and a 1 if it is zero.
Ingredients.
200 g current value butter
1 teaspoon unitary methi seeds
Method.
Fold current value butter into 3rd mixing bowl.
Put unitary methi seeds into 1st mixing bowl.
Melt the current value butter.
Remove unitary methi seeds from 1st mixing bowl.
Refrigerate.
Simmer until melted.
Refrigerate.
Tsp Tbsp Cups Tsp Tbsp Cups Tsp Tbsp Cups Tsp Tbsp Cups

1/4

17/4 33/4 11/4 49/4

1/2

9/2

3/2

17/2 25/2

3/4

1/4

19/4 35/4 51/4 17/4

1

1/3

5

5/3

9

3

13

13/3

5/4

21/4

7/4

37/4 53/4

3/2

1/2

11/2 19/2 27/2

9/2

7/4

23/4 39/4 13/4 55/4

2

2/3

6

2

10

10/3

14

14/3

9/4

3/4

25/4 41/4 57/4 19/4

5/2

13/2 21/2

7/2

29/2
11/4 27/4

9/4

43/4 59/4

3

1

7

7/3

11

11/3

15

5

13/4 29/4 45/4 15/4 61/4

7/2

15/2

5/2

23/2 31/2
15/4

5/4

31/4 47/4 63/4 21/4

4

4/3

8

8/3

12

4

1/4

16

16/3

1/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment