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/pools/gr.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 / pools / gr.om` 60 lines ยท 1106 bytes Raw Blame History 1 note gate-pools 3: a uchar pool filled by read 0 P off n from a pipe, n given by a function that enlarges P 2 note (and a blocker B above it) by 65536 elements before every read; then the bytes are written back and their 3 note count printed. The gate feeds it `seq 1 200000` through a pipe; its expected output is built there. 4 global B uchar * 5 global P uchar * 6 global ob uchar 24 7 fn pnum v ulong to void 8 put ob 23 10 9 i = ulong 23 10 x = v 11 go = true 12 while go bound 21 13 i = sub i 1 14 put ob i uchar add rem x 10 48 15 x = div x 10 16 go = ne x 0 17 end 18 k = write 1 ob i sub 24 i 19 end 20 fn plong v long to void 21 if lt v 0 22 put ob 0 uchar 45 23 k = write 1 ob 0 1 24 pnum ulong neg v 25 else 26 pnum ulong v 27 end 28 end 29 fn gn n ulong to ulong 30 r = enlarge B add len B 4096 31 r = enlarge P add len P n 32 ret n 33 end 34 fn main to int 35 r = enlarge B ulong 1 36 r = enlarge P ulong 1 37 used = ulong 0 38 go = true 39 while go bound 100000 40 k = read 0 P used gn 65536 41 if lt k 0 42 ret 2 43 end 44 if eq k 0 45 go = false 46 else 47 used = add used ulong k 48 end 49 end 50 o = ulong 0 51 while lt o used bound 100000 52 k = write 1 P o sub used o 53 if le k 0 54 ret 3 55 end 56 o = add o ulong k 57 end 58 pnum used 59 ret 0 60 end