uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 4ef304c57938c9cc7e9ed5c637d820786c75527b
parent 8cccc5c91987ac4260ef40f7b0f248cbc9ed8018
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Fri,  8 Mar 2024 15:55:58 -0800

(sierpinski) Optimization

Diffstat:
Mprojects/examples/exercises/sierpinski.tal | 34+++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)

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