interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / drafts / rosettacode / rot-13.wiki

46 lines · 965 bytes Raw Blame History
1=={{header|Omegese}}==
2{{works with|omc|sha256 2c824805, aien-dev/omega-mv e5b32567, Linux AArch64}}
3Omega has no imports, so the small output helpers (<code>emit</code> and friends) are part of the program.
4<syntaxhighlight lang="text">
5om2
6text nl "\n"
7text s1 "Hello, World!"
8text s2 "The Quick Brown Fox Jumps Over The Lazy Dog."
9note emit writes every byte of a to stdout; a short write is retried, an error exits 1
10fn emit a view uchar * to void
11o = ulong 0
12while lt o len a bound 4096
13k = write 1 a o sub len a o
14if le k 0
15exit 1
16end
17o = add o ulong k
18end
19end
20fn rot13 a view uchar * to void
21r = new uchar 256 0
22for i ulong len a
23c = get a i
24if and ge c 65 le c 90
25c = add rem add sub c 65 13 26 65
26else
27if and ge c 97 le c 122
28c = add rem add sub c 97 13 26 97
29end
30end
31put r i c
32end
33emit part r 0 len a
34emit nl
35end
36fn main to int
37rot13 s1
38rot13 s2
39ret 0
40end
41</syntaxhighlight>
42{{out}}
43<pre>
44Uryyb, Jbeyq!
45Gur Dhvpx Oebja Sbk Whzcf Bire Gur Ynml Qbt.
46</pre>