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 / coder / eval / selftest / src / st6-stdin.om

32 lines · 541 bytes Raw Blame History
1note selftest: copy stdin to stdout with the case of each letter swapped. Fed its own output it gives back its
2note input, so a case line that fed the program expected.out instead of stdin would fail.
3global buf uchar 4096
4fn main to int
5n = read 0 buf 0 len buf
6while gt n 0
7m = ulong n
8for i ulong m
9c = get buf i
10if ge c 97
11if le c 122
12put buf i uchar sub c 32
13end
14else
15if ge c 65
16if le c 90
17put buf i uchar add c 32
18end
19end
20end
21end
22w = write 1 buf 0 ulong n
23if ne w n
24ret 1
25end
26n = read 0 buf 0 len buf
27end
28if lt n 0
29ret 2
30end
31ret 0
32end