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 / seed / omc / tests / struct-bool / adjacent.om

32 lines · 556 bytes Raw Blame History
1note adjacent.om: three bool fields in a row hold independent values. x y z = true false true
2note reads as bits 1 + 4 = 5 (checked first); after put y true, put x false it reads 2 + 4 = 6.
3struct B x bool y bool z bool end
4fn main to uint
5b = new B true false true
6r = uint 0
7if eq get b x true
8r = add r 1
9end
10if eq get b y true
11r = add r 2
12end
13if eq get b z true
14r = add r 4
15end
16if ne r 5
17ret 90
18end
19put b y true
20put b x false
21r = uint 0
22if eq get b x true
23r = add r 1
24end
25if eq get b y true
26r = add r 2
27end
28if eq get b z true
29r = add r 4
30end
31ret r
32end