Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-rosetta/blob/main/drafts/rosettacode/string-case.wiki # omega-rosetta aien-dev/omega-rosetta Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-rosetta / drafts / rosettacode / string-case.wiki` 51 lines ยท 1032 bytes Raw Blame History 1 =={{header|Omegese}}== 2 {{works with|omc|sha256 `2c824805`, aien-dev/omega-mv `e5b32567`, Linux AArch64}} 3 Omega has no imports, so the small output helpers (emit and friends) are part of the program. 4 5 om2 6 text nl "\n" 7 text s "alphaBETA" 8 note emit writes every byte of a to stdout; a short write is retried, an error exits 1 9 fn emit a view uchar * to void 10 o = ulong 0 11 while lt o len a bound 4096 12 k = write 1 a o sub len a o 13 if le k 0 14 exit 1 15 end 16 o = add o ulong k 17 end 18 end 19 note upper, lower and swap change ASCII letters only; strings up to 256 bytes (longer traps 3) 20 fn conv a view uchar * mode ulong to void 21 r = new uchar 256 0 22 for i ulong len a 23 c = get a i 24 up = and ge c 65 le c 90 25 lo = and ge c 97 le c 122 26 if and lo ne mode 1 27 c = sub c 32 28 else 29 if and up ne mode 0 30 c = add c 32 31 end 32 end 33 put r i c 34 end 35 emit part r 0 len a 36 emit nl 37 end 38 fn main to int 39 note mode 0 upper, 1 lower, 2 swap case 40 conv s 0 41 conv s 1 42 conv s 2 43 ret 0 44 end 45 46 {{out}} 47

48 ALPHABETA

49 alphabeta

50 ALPHAbeta

51