fa/doc/md/LOOPS.md
Ari Archer c30a3de674
Deprecate mutability contexts
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-07-27 13:41:50 +03:00

29 lines
449 B
Markdown

# Loops in fa
Loops are conditional pieces of code that loop, they're mainly
syntactical sugar for `label` keyword
## While loops
While loops are loops which loop while the condition
is true, the syntax is as follows:
```fa
while <code> do
...
end
```
Between while and do there must be a block of code which
pushes at the end
Example:
```fa
0 while copy 10 grt do
"Hi" #puts
1 add
end 2 drop
```
This will print `"Hi"` 10 times