Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
def N=5;
int A(N,N);
int I, J, X, Y, Steps, Dir;
include c:\cxpl\codes;
[Clear;
I:= 0; X:= -1; Y:= 0; Steps:= N; Dir:= 0;
repeat for J:= 1 to Steps do
[case Dir&3 of
0: X:= X+1;
1: Y:= Y+1;
2: X:= X-1;
3: Y:= Y-1
other [];
A(X,Y):= I;
Cursor(X*3,Y); IntOut(0,I);
I:= I+1;
];
Dir:= Dir+1;
if Dir&1 then Steps:= Steps-1;
until Steps = 0;
Cursor(0,N);
]