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 / remove-vowels-from-a-string.wiki

51 lines · 1052 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 msg "Rosetta Code is a programming chrestomathy site, AEIOU and aeiou alike."
8text vow "aeiouAEIOU"
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
20note emitc writes one byte
21fn emitc c uchar to void
22b = new uchar 1 0
23put b 0 c
24emit b
25end
26fn isvowel c uchar to bool
27for i ulong len vow
28if eq c get vow i
29ret true
30end
31end
32ret false
33end
34fn main to int
35emit msg
36emit nl
37for i ulong len msg
38c = get msg i
39if not isvowel c
40emitc c
41end
42end
43emit nl
44ret 0
45end
46</syntaxhighlight>
47{{out}}
48<pre>
49Rosetta Code is a programming chrestomathy site, AEIOU and aeiou alike.
50Rstt Cd s prgrmmng chrstmthy st, nd lk.
51</pre>