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 / si / harness / coder / eval / cat.om
| 1 | note cat: copy standard input to standard output. score.sh runs it through the om2 gate with a program's saved |
| 2 | note output as input and the task's expected output as the expected stdout, so the comparison is the gate's. |
| 3 | note A short write continues; a failed write exits 90, a failed read exits 91. |
| 4 | global buf uchar 65536 |
| 5 | fn main to int |
| 6 | n = read 0 buf 0 len buf |
| 7 | while gt n 0 |
| 8 | p = ulong 0 |
| 9 | e = ulong n |
| 10 | while lt p e |
| 11 | k = write 1 buf p sub e p |
| 12 | if le k 0 |
| 13 | exit 90 |
| 14 | end |
| 15 | p = add p ulong k |
| 16 | end |
| 17 | n = read 0 buf 0 len buf |
| 18 | end |
| 19 | if lt n 0 |
| 20 | exit 91 |
| 21 | end |
| 22 | ret 0 |
| 23 | end |