interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / pangram-checker / pangram-checker.om

54 lines · 1017 bytes Raw Blame History
1note Rosetta Code task "Pangram checker": https://rosettacode.org/wiki/Pangram_checker
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3om2
4text nl "\n"
5text tq "\""
6text tis "\" is a pangram\n"
7text tnot "\" is not a pangram\n"
8text p1 "The quick brown fox jumps over the lazy dog"
9text p2 "The quick brown fox jumped over the lazy dog"
10text p3 "Pack my box with five dozen liquor jugs."
11note emit writes every byte of a to stdout; a short write is retried, an error exits 1
12fn emit a view uchar * to void
13o = ulong 0
14while lt o len a bound 4096
15k = write 1 a o sub len a o
16if le k 0
17exit 1
18end
19o = add o ulong k
20end
21end
22fn pangram a view uchar * to bool
23seen = new uchar 26 0
24for i ulong len a
25c = get a i
26if and ge c 65 le c 90
27c = add c 32
28end
29if and ge c 97 le c 122
30put seen sub c 97 1
31end
32end
33for j ulong 26
34if eq get seen j 0
35ret false
36end
37end
38ret true
39end
40fn show a view uchar * to void
41emit tq
42emit a
43if pangram a
44emit tis
45else
46emit tnot
47end
48end
49fn main to int
50show p1
51show p2
52show p3
53ret 0
54end