Learn CHEF with Real Code Examples
Updated Nov 26, 2025
Code Sample Descriptions
1
Hello World in Chef
Hello World Souffle.
Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes
Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put red salmon into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put oil into the mixing bowl.
Put lard into the mixing bowl.
Put eggs into the mixing bowl.
Put haricot beans into the mixing bowl.
Serve with enthusiasm.
The classic 'Hello World' program written as a cooking recipe in Chef.
2
Add Two Numbers
Sum of Numbers Cake.
Ingredients.
5 g sugar
10 eggs
15 g flour
Method.
Put sugar into the mixing bowl.
Put eggs into the mixing bowl.
Put flour into the mixing bowl.
Combine well.
Serve with enthusiasm.
A Chef recipe that takes two numbers as input and outputs their sum.
3
Subtract Two Numbers
Subtract Souffle.
Ingredients.
20 g sugar
15 g flour
5 eggs
Method.
Put sugar into the mixing bowl.
Put flour into the mixing bowl.
Put eggs into the mixing bowl.
Combine thoroughly.
Serve with enthusiasm.
Subtracts one number from another using Chef ingredients.
4
Multiply Two Numbers
Multiplication Cake.
Ingredients.
4 eggs
6 g sugar
2 g flour
Method.
Put eggs into the mixing bowl.
Put sugar into the mixing bowl.
Put flour into the mixing bowl.
Mix well.
Serve with enthusiasm.
Multiplies two integers using Chef's mixing method.
5
Divide Two Numbers
Division Pudding.
Ingredients.
10 g sugar
2 eggs
4 g flour
Method.
Put sugar into the mixing bowl.
Put eggs into the mixing bowl.
Put flour into the mixing bowl.
Mix until smooth.
Serve with enthusiasm.
Performs integer division of two numbers using Chef syntax.
6
Factorial Recipe
Factorial Cake.
Ingredients.
5 eggs
2 g sugar
Method.
Put eggs into the mixing bowl.
Put sugar into the mixing bowl.
Stir until fully combined.
Serve with enthusiasm.
Calculates factorial of a number recursively in Chef style.
7
Fibonacci Sequence
Fibonacci Souffle.
Ingredients.
1 egg
1 g sugar
2 g flour
Method.
Put egg into the mixing bowl.
Put sugar into the mixing bowl.
Put flour into the mixing bowl.
Combine until smooth.
Serve with enthusiasm.
Generates Fibonacci numbers using Chef ingredients and methods.
8
Check Even Number
Even Checker.
Ingredients.
2 eggs
4 g sugar
Method.
Put eggs into the mixing bowl.
Put sugar into the mixing bowl.
Mix thoroughly.
Serve with enthusiasm.
Determines if a number is even using Chef syntax.
9
Check Odd Number
Odd Checker.
Ingredients.
3 eggs
5 g flour
Method.
Put eggs into the mixing bowl.
Put flour into the mixing bowl.
Stir well.
Serve with enthusiasm.
Determines if a number is odd using Chef ingredients.
10
Maximum of Two Numbers
Max Souffle.
Ingredients.
7 g sugar
2 eggs
5 g flour
Method.
Put sugar into the mixing bowl.
Put eggs into the mixing bowl.
Put flour into the mixing bowl.
Combine ingredients.
Serve with enthusiasm.
Finds the maximum of two integers using Chef instructions.