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
omega-mv / seed / ng / front / runs / p-partok.om
| 1 | om2 |
| 2 | note p-partok: as p-part with the last part in range (6, 2): exit status (x + y) mod 256 |
| 3 | fn sum a view uint * to ulong |
| 4 | s = ulong 0 |
| 5 | for i ulong len a |
| 6 | s = add s ulong get a i |
| 7 | end |
| 8 | ret s |
| 9 | end |
| 10 | fn bump a edit uint * v uint to void |
| 11 | for i ulong len a |
| 12 | put a i add get a i v |
| 13 | end |
| 14 | end |
| 15 | fn main to int |
| 16 | b = new uint 8 0 |
| 17 | for i ulong 8 |
| 18 | put b i uint add i 1 |
| 19 | end |
| 20 | bump part b 4 2 100 |
| 21 | x = sum b |
| 22 | y = sum part b 2 3 |
| 23 | z = sum part b 6 2 |
| 24 | ret int add x y |
| 25 | end |