interplane.Get Omega
Read in your language

omega-harness

Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories

Brought by drakestapleton

branch main Branches Tags History

omega-harness / examples / p10_profile.om

39 lines · 770 bytes Raw Blame History
1note p10_profile: annotations read by the critical source profile seed/profile/profile.om
2note (omega-mv #1063, on main). omc treats them as notes; the profile enforces them:
3note "note p10 pure" (no put, pure callees only), "note p10 effect" (host words allowed),
4note bounded while (bound <= 8192) and every assigned call result read before it is lost.
5global ob uchar 24
6note p10 pure
7fn sq v ulong to ulong
8ret mul v v
9end
10note p10 effect
11fn outu v ulong to ulong
12i = ulong 23
13put ob 23 10
14n = v
15while true bound 20
16i = sub i 1
17put ob i uchar add rem n 10 48
18n = div n 10
19if eq n 0
20break
21end
22end
23w = write 1 ob i sub 24 i
24if ne w long sub 24 i
25ret 1
26end
27ret 0
28end
29fn main to int
30s = ulong 0
31for k ulong 10
32s = add s sq k
33end
34e = outu s
35if ne e 0
36ret 1
37end
38ret 0
39end