Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,45 @@
include "cowgol.coh";
sub print_back(s: [uint8]) is
while [s] != 0 loop;
print_char([s]);
s := @prev s;
end loop;
print_nl();
end sub;
sub incr(n: [uint8]): (r: [uint8]) is
r := n;
while [n] != 0 loop;
n := @prev n;
end loop;
n := @next n;
loop
if [n] == 0 then
[n] := '1';
[@next n] := 0;
r := n;
break;
elseif [n] == '9' then
[n] := '0';
n := @next n;
continue;
else
[n] := [n] + 1;
break;
end if;
end loop;
end sub;
sub init(n: [uint8]): (r: [uint8]) is
[n] := 0;
[n+1] := '0';
[n+2] := 0;
r := n+1;
end sub;
var infnum := init(LOMEM);
loop
infnum := incr(infnum);
print_back(infnum);
end loop;