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/apps/aienos-site/om/lab-page/harness.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 / apps / aienos-site / om / lab-page / harness.om` 67 lines ยท 1074 bytes Raw Blame History 1 note Host harness for the lab kernel: reads "A N" from stdin, runs the grid in 2 note blocks of at most 999999 elements and prints the checksum in decimal. 3 fn putdec v long to int 4 buf = new uchar 24 0 5 i = ulong 23 6 put buf i uchar 10 7 x = v 8 if lt v long 0 9 x = neg v 10 end 11 while true bound 24 12 i = sub i ulong 1 13 put buf i uchar add rem x long 10 long 48 14 x = div x long 10 15 if eq x long 0 16 break 17 end 18 end 19 if lt v long 0 20 i = sub i ulong 1 21 put buf i uchar 45 22 end 23 n = write 1 buf i sub ulong 24 i 24 if ne n long sub ulong 24 i 25 ret 1 26 end 27 ret 0 28 end 29 fn main to int 30 inp = new uchar 64 0 31 got = read 0 inp 0 len inp 32 if le got 0 33 ret 2 34 end 35 vals = new long 2 0 36 k = ulong 0 37 seen = false 38 p = ulong 0 39 while lt p ulong got bound 64 40 b = get inp p 41 if and ge b 48 le b 57 42 if lt k ulong 2 43 put vals k add mul get vals k long 10 long sub b 48 44 end 45 seen = true 46 else 47 if seen 48 k = add k ulong 1 49 end 50 seen = false 51 end 52 p = add p ulong 1 53 end 54 a = get vals 0 55 n = get vals 1 56 s = long 0 57 lo = long 0 58 while lt lo n bound 999999 59 hi = add lo long 999999 60 if gt hi n 61 hi = n 62 end 63 s = add s run a lo hi 64 lo = hi 65 end 66 ret putdec s 67 end