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/collatz-conjecture/.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 / collatz-conjecture / .meta / example.om` 18 lines ยท 487 bytes Raw Blame History 1 note Exercism-style exercise "collatz-conjecture": https://exercism.org/tracks/python/exercises/collatz-conjecture 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note Return how many steps n takes to reach 1 (n even: n / 2, n odd: 3n + 1). steps 1 is 0. 4 note Check it with: sh exercise.sh exercises/collatz-conjecture 5 om2 6 fn steps n ulong to ulong 7 v = n 8 c = ulong 0 9 while ne v 1 bound 999999 10 if eq rem v 2 0 11 v = div v 2 12 else 13 v = add mul v 3 1 14 end 15 c = add c 1 16 end 17 ret c 18 end