(sierpinski) Optimization

This commit is contained in:
Devine Lu Linvega 2024-03-08 15:55:58 -08:00
parent 8cccc5c919
commit 4ef304c579
1 changed files with 15 additions and 19 deletions

View File

@ -1,22 +1,18 @@
( uxncli sierpinski.rom ) ( uxncli sierpinski.rom )
@on-reset ( -> ) @sierpinski ( -> )
[ LIT &size 20 ] STHk #01 SUB [ LIT &size 10 ] STHk #01 SUB
&ver ( -- ) &>ver ( -- )
DUP DUP INCk
#00 EQUk ?{ &>pad ( length -- )
&pad ( -- )
#2018 DEO #2018 DEO
INC GTHk ?&pad #01 SUB DUP ?&>pad
} POP &>fill ( length i -- )
#00 ANDk #202a ROT ?{ SWP }
&fill POP #18 DEO
ANDk #202a ROT ?{ SWP } POP #18 DEO
#2018 DEO #2018 DEO
INC ADDk STHkr LTH ?&fill INC ADDk STHkr LTH ?&>fill
POP2 POP2 #0a18 DEO
#0a18 DEO #01 SUB INCk ?&>ver
#01 SUB INCk ?&ver POP POPr BRK
POP POPr
BRK