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/armstrong-numbers/.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 / armstrong-numbers / .meta / example.om` 28 lines ยท 579 bytes Raw Blame History 1 note Exercism-style exercise "armstrong-numbers": https://exercism.org/tracks/python/exercises/armstrong-numbers 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note Return true when n equals the sum of its digits, each raised to the number of digits. 4 note Check it with: sh exercise.sh exercises/armstrong-numbers 5 om2 6 fn armstrong n ulong to bool 7 k = ulong 0 8 v = n 9 while true bound 20 10 k = add k 1 11 v = div v 10 12 if eq v 0 13 break 14 end 15 end 16 s = ulong 0 17 v = n 18 for i ulong k 19 d = rem v 10 20 p = ulong 1 21 for j ulong k 22 p = mul p d 23 end 24 s = add s p 25 v = div v 10 26 end 27 ret eq s n 28 end