interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / loops-for / loops-for.om

26 lines · 523 bytes Raw Blame History
1note Rosetta Code task "Loops/For": https://rosettacode.org/wiki/Loops/For
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3om2
4text nl "\n"
5text star "*"
6note emit writes every byte of a to stdout; a short write is retried, an error exits 1
7fn emit a view uchar * to void
8o = ulong 0
9while lt o len a bound 4096
10k = write 1 a o sub len a o
11if le k 0
12exit 1
13end
14o = add o ulong k
15end
16end
17note row i has i + 1 stars, five rows
18fn main to int
19for i ulong 5
20for j ulong add i 1
21emit star
22end
23emit nl
24end
25ret 0
26end