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/seed/omc/tests/struct-bool/loop_toggle.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 / seed / omc / tests / struct-bool / loop_toggle.om` 21 lines ยท 419 bytes Raw Blame History 1 note loop_toggle.om: put and get on a bool field inside a loop. Seven flips from false end true; 2 note the count of times the field read true on the way is 3. Result 3 * 10 + 1. 3 struct W n uint f bool end 4 fn main to uint 5 w = new W 0 false 6 for i uint 7 7 if eq get w f true 8 put w n add get w n 1 9 end 10 if eq get w f true 11 put w f false 12 else 13 put w f true 14 end 15 end 16 r = mul get w n 10 17 if eq get w f true 18 r = add r 1 19 end 20 ret r 21 end