Otter
Snippets
Otter
Upstream Otter 1.0.1 Tested
While Loop
Execute statements repeatedly while a condition evaluates to true.
Architecture & Runtime Preview
Otter 1.0.1Zero-dependency Otter 1.0.1 snippet (Control Flow). Copy the parameterized template or run the self-contained example.
- 1Category: Control Flow
- 2Attribution: Otter Core Language Spec (D35)
- 3Zero external pack dependencies — paste directly into any .ot file
Source Code (2 files)
while ${condition}
# statements
.
counter is 3
while counter is greater than 0
say "Countdown:" counter
decrease counter
.
if counter is not 0
fail with "while-loop termination mismatch: expected 0"
.
Installation & Usage
otter snippet inspect cf-while-loop
Copy template.ot directly into your .ot source file, or run example.ot with 'otter run example.ot'.