{"id":"recipe--decisions","name":"Teach your game a rule","owner":"yeho","package":"recipes","kind":"recipe","signature":"start.yh","description":"Choose what happens with if and else.","context":"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.","parameters":[],"returns":"","members":[],"tags":["cpu","recipe"],"updated":"2026-09-09","source":{"repository":"demonhunterlabs","path":"app/lib/yeho-walkthrough.ts"},"status":"complete-program","notes":["Try crystal counts 2, 3, and 4. Then change >= to > and repeat those three checks."],"examples":[{"id":"program","title":"Teach your game a rule","description":"Choose what happens with if and else.","code":"int crystals = 3\nif crystals >= 3\n{\n    Console.Log(\"The door opens!\")\n}\nelse\n{\n    Console.Log(\"Find a few more crystals.\")\n}","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__decisions\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","tags":["cpu"],"run":"cpu-oracle","expected":"The door opens!","verification":"type checked","sha256":"eec9ae87893184946f3ac7d6b56c42b0abe1fb3a46935e56d5040ccc2dc0868b","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--decisions","json":"https://demonhunterlabs.com/reference/items/recipe--decisions.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--decisions.md"}
