0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-26 15:53:01 +00:00

(hilbert.tal) Animated

This commit is contained in:
Devine Lu Linvega 2023-03-13 10:22:19 -07:00
parent 39fa5851eb
commit b38e328078

View file

@ -11,14 +11,18 @@
#7f0a .System/g DEO2
#8e0a .System/b DEO2
( screen size )
#0140 .Screen/width DEO2
#0140 .Screen/height DEO2
( draw )
#03ff #0000
&l
STH2k INC2k d2xy STH2r d2xy #01 draw-line
INC2 GTH2k ?&l
POP2 POP2
#00c0
DUP2 .Screen/width DEO2
.Screen/height DEO2
( vector )
;on-frame .Screen/vector DEO2
BRK
@on-frame ( -> )
[ LIT2 &f $2 ] INC2k ,&f STR2
INC2k d2xy ROT2 d2xy #01 draw-line
BRK
@ -28,9 +32,9 @@ BRK
#0000
DUP2 ,&x STR2
,&y STR2
#0020 #0001
#2001
&l
STH2k
#00 OVR STH2
[ LIT2 &t $2 ]
DUP2 DUP2 #01 SFT2 #0001 AND2 DUP2 ,&rx STR2
EOR2 #0001 AND2 ,&ry STR2
@ -39,16 +43,16 @@ BRK
STH2kr rot
STH2kr ,&ry LDR2 MUL2 ADD2 ,&y STR2
STH2r ,&rx LDR2 MUL2 ADD2 ,&x STR2
DUP2 ADD2 GTH2k ?&l
POP2 POP2
,&x LDR2 #30 SFT2 #0020 ADD2
,&y LDR2 #30 SFT2 #0020 ADD2
DUP ADD GTHk ?&l
POP2
,&x LDR2 #20 SFT2 #0020 ADD2
,&y LDR2 #20 SFT2 #0020 ADD2
JMP2r
@rot ( x* y* rx* ry* n* -- x* y* )
( n-1 ) #0001 SUB2 STH2
#0001 SUB2 STH2
SWP2 ,&rx STR2
ORA ?&skipy
[ LIT2 &rx $2 ] #0001 NEQ2 ?&skipx