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-mv/blob/main/si/rosetta/exercises/acronym/.meta/example.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / si / rosetta / exercises / acronym / .meta / example.om` 28 lines ยท 690 bytes Raw Blame History 1 note Exercism-style exercise "acronym": https://exercism.org/tracks/python/exercises/acronym 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note abbreviate writes the upper-case acronym of phrase s into o and returns its length. Words are 4 note separated by spaces, hyphens and other punctuation; an apostrophe does not start a new word. 5 note Check it with: sh exercise.sh exercises/acronym 6 om2 7 fn abbreviate s view uchar * o edit uchar * to ulong 8 p = ulong 0 9 prev = false 10 for i ulong len s 11 c = get s i 12 up = and ge c 65 le c 90 13 lo = and ge c 97 le c 122 14 if or up lo 15 if not prev 16 if lo 17 c = sub c 32 18 end 19 put o p c 20 p = add p 1 21 end 22 prev = true 23 else 24 prev = eq c 39 25 end 26 end 27 ret p 28 end