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/exercises/rotational-cipher/.meta/example.om # 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 / exercises / rotational-cipher / .meta / example.om` 21 lines ยท 682 bytes Raw Blame History 1 note Exercism-style exercise "rotational-cipher": https://exercism.org/tracks/python/exercises/rotational-cipher 2 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 note rotate writes s into o with every letter shifted key places along the alphabet (keeping its 4 note case, wrapping z to a) and every other byte unchanged; returns the length. 5 note Check it with: sh exercise.sh exercises/rotational-cipher 6 om2 7 fn rotate s view uchar * key ulong o edit uchar * to ulong 8 k = uchar rem key 26 9 for i ulong len s 10 c = get s i 11 if and ge c 65 le c 90 12 c = add 65 rem add sub c 65 k 26 13 else 14 if and ge c 97 le c 122 15 c = add 97 rem add sub c 97 k 26 16 end 17 end 18 put o i c 19 end 20 ret len s 21 end