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
omega-mv / si / rosetta / exercises / rna-transcription / .meta / example.om
| 1 | note Exercism-style exercise "rna-transcription": https://exercism.org/tracks/python/exercises/rna-transcription |
| 2 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | note torna writes the RNA complement of DNA strand dna into o (G to C, C to G, T to A, A to U) |
| 4 | note and returns its length. |
| 5 | note Check it with: sh exercise.sh exercises/rna-transcription |
| 6 | om2 |
| 7 | fn torna dna view uchar * o edit uchar * to ulong |
| 8 | for i ulong len dna |
| 9 | c = get dna i |
| 10 | r = uchar 0 |
| 11 | if eq c 71 |
| 12 | r = uchar 67 |
| 13 | end |
| 14 | if eq c 67 |
| 15 | r = uchar 71 |
| 16 | end |
| 17 | if eq c 84 |
| 18 | r = uchar 65 |
| 19 | end |
| 20 | if eq c 65 |
| 21 | r = uchar 85 |
| 22 | end |
| 23 | put o i r |
| 24 | end |
| 25 | ret len dna |
| 26 | end |