interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / si / rosetta / tasks / rot-13 / rot-13.om

38 lines · 758 bytes Raw Blame History
1note Rosetta Code task "Rot-13": https://rosettacode.org/wiki/Rot-13
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3om2
4text nl "\n"
5text s1 "Hello, World!"
6text s2 "The Quick Brown Fox Jumps Over The Lazy Dog."
7note emit writes every byte of a to stdout; a short write is retried, an error exits 1
8fn emit a view uchar * to void
9o = ulong 0
10while lt o len a bound 4096
11k = write 1 a o sub len a o
12if le k 0
13exit 1
14end
15o = add o ulong k
16end
17end
18fn rot13 a view uchar * to void
19r = new uchar 256 0
20for i ulong len a
21c = get a i
22if and ge c 65 le c 90
23c = add rem add sub c 65 13 26 65
24else
25if and ge c 97 le c 122
26c = add rem add sub c 97 13 26 97
27end
28end
29put r i c
30end
31emit part r 0 len a
32emit nl
33end
34fn main to int
35rot13 s1
36rot13 s2
37ret 0
38end