{"id":"recipe--loops","name":"Repeat without copying lines","owner":"yeho","package":"recipes","kind":"recipe","signature":"start.yh","description":"Use a loop to count and draw repeated behavior.","context":"If your planet has ten animals, you should not need ten copies of the same instruction. A loop repeats a block and gives each repetition a value to work with. This range loop starts i at zero and continues while i is less than four. That gives four visits: zero, one, two, and three. Zero is a very common starting point in code.","parameters":[],"returns":"","members":[],"tags":["cpu","recipe"],"updated":"2026-09-09","source":{"repository":"demonhunterlabs","path":"app/lib/yeho-walkthrough.ts"},"status":"complete-program","notes":["Make six crystal messages. Then start at one and include six. Compare the count with the numbers printed."],"examples":[{"id":"program","title":"Repeat without copying lines","description":"Use a loop to count and draw repeated behavior.","code":"for i from 0 < 4\n{\n    Console.Log(\"Crystal \" + Text.From(i))\n}","manifest":"manifestVersion = \"2\"\npackage = \"api.example.recipe__loops\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","tags":["cpu"],"run":"cpu-oracle","expected":"Crystal 0\nCrystal 1\nCrystal 2\nCrystal 3","verification":"type checked","sha256":"e2ccc197a005e0312d2ce3e9bbe7ebefcdb8b869adb158457375f804157cb71c","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=recipe--loops","json":"https://demonhunterlabs.com/reference/items/recipe--loops.json","markdown":"https://demonhunterlabs.com/reference/text/recipe--loops.md"}
