{"id":"language--while-loop","name":"While loops","owner":"yeho","package":"language","kind":"language","signature":"while condition { ... }","description":"while repeats a block while its bool condition remains true.","context":"Use while when the stopping condition is more natural than a known collection or numeric range.","parameters":[],"returns":"","members":[],"tags":["cpu","language","loops","while","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"parser_statements.cpp parseWhileStatement; Kyber loop runtime fixtures"},"status":"stable","notes":["The condition must be bool.","Update the condition's inputs inside the loop unless an external event owns progress."],"examples":[{"id":"complete","title":"Complete while loops example","description":"Use while when the stopping condition is more natural than a known collection or numeric range.","code":"int health = 30\nwhile health > 0\n{\n    Console.Log(Text.From(health))\n    health = health - 10\n}\n","tags":["cpu","language"],"run":"cpu-oracle","expected":null,"verifyRun":false,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.language__while_loop\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","verification":"type checked","sha256":"e43db5fbc36d79952a22c6d1f6dcd4cf00c96dd3a7c41e4673cc146209316ae1","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=language--while-loop","json":"https://demonhunterlabs.com/reference/items/language--while-loop.json","markdown":"https://demonhunterlabs.com/reference/text/language--while-loop.md"}
