interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / si / rosetta / exercises / nucleotide-count / .meta / example.om

32 lines · 711 bytes Raw Blame History
1note Exercism-style exercise "nucleotide-count": https://exercism.org/tracks/python/exercises/nucleotide-count
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note nucleotidecounts writes how many A, C, G and T the DNA strand holds into o[0] .. o[3] and is
4note true; it is false when the strand holds any other byte.
5note Check it with: sh exercise.sh exercises/nucleotide-count
6om2
7fn nucleotidecounts strand view uchar * o edit ulong * to bool
8for j ulong 4
9put o j 0
10end
11for i ulong len strand
12c = get strand i
13k = ulong 4
14if eq c 65
15k = ulong 0
16end
17if eq c 67
18k = ulong 1
19end
20if eq c 71
21k = ulong 2
22end
23if eq c 84
24k = ulong 3
25end
26if eq k 4
27ret false
28end
29put o k add get o k 1
30end
31ret true
32end