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 / pangram-checker.wiki

63 lines · 1326 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 tq "\""
8text tis "\" is a pangram\n"
9text tnot "\" is not a pangram\n"
10text p1 "The quick brown fox jumps over the lazy dog"
11text p2 "The quick brown fox jumped over the lazy dog"
12text p3 "Pack my box with five dozen liquor jugs."
13note emit writes every byte of a to stdout; a short write is retried, an error exits 1
14fn emit a view uchar * to void
15o = ulong 0
16while lt o len a bound 4096
17k = write 1 a o sub len a o
18if le k 0
19exit 1
20end
21o = add o ulong k
22end
23end
24fn pangram a view uchar * to bool
25seen = new uchar 26 0
26for i ulong len a
27c = get a i
28if and ge c 65 le c 90
29c = add c 32
30end
31if and ge c 97 le c 122
32put seen sub c 97 1
33end
34end
35for j ulong 26
36if eq get seen j 0
37ret false
38end
39end
40ret true
41end
42fn show a view uchar * to void
43emit tq
44emit a
45if pangram a
46emit tis
47else
48emit tnot
49end
50end
51fn main to int
52show p1
53show p2
54show p3
55ret 0
56end
57</syntaxhighlight>
58{{out}}
59<pre>
60"The quick brown fox jumps over the lazy dog" is a pangram
61"The quick brown fox jumped over the lazy dog" is not a pangram
62"Pack my box with five dozen liquor jugs." is a pangram
63</pre>