recipes · recipe ·

Teach your game a rule

Choose what happens with if and else.

cpurecipe

A game rule often begins with if: if you have a key, open the door; if you are out of lives, stop the round. The condition is the question we ask. Below, >= means greater than or equal to. The braces group the instructions belonging to each answer. Only one of these two blocks will run.

start.yh

Status: complete-program

Teach your game a rule

Choose what happens with if and else.

cpu · type checked

int crystals = 3
if crystals >= 3
{
    Console.Log("The door opens!")
}
else
{
    Console.Log("Find a few more crystals.")
}
project.mech
manifestVersion = "2"
package = "api.example.recipe__decisions"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"
Expected output
The door opens!
Notes and source

Try crystal counts 2, 3, and 4. Then change >= to > and repeat those three checks.

demonhunterlabs/app/lib/yeho-walkthrough.ts