uxn/projects/examples/exercises/sierpinski.tal

18 lines
319 B
Tal

( uxncli sierpinski.rom )
@sierpinski ( -> )
[ LIT &size 10 ] STHk #01 SUB
&>ver ( -- )
DUP INCk
&>pad ( length -- )
#2018 DEO
#01 SUB DUP ?&>pad
&>fill ( length i -- )
ANDk #2018 DEOk SWP ROT ?{ #0a ORA }
SWP DEO
INC ADDk STHkr LTH ?&>fill
POP2 #0a18 DEO
#01 SUB INCk ?&>ver
POP POPr BRK