From d7ee187d1df7a6ca65ed954be11e2de8c10c89b6 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 8 Mar 2024 16:39:45 -0800 Subject: [PATCH] (sierpinski) Optimization --- projects/examples/exercises/sierpinski.tal | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/examples/exercises/sierpinski.tal b/projects/examples/exercises/sierpinski.tal index a79de01..c98eff2 100644 --- a/projects/examples/exercises/sierpinski.tal +++ b/projects/examples/exercises/sierpinski.tal @@ -1,17 +1,17 @@ ( uxncli sierpinski.rom ) @sierpinski ( -> ) - [ LIT &size 10 ] STHk #01 SUB + ( mask ) [ LIT2r 0a18 ] [ LIT2r 2018 ] + ( size ) [ LIT &size 10 ] #01 SUB &>ver ( -- ) DUP INCk &>pad ( length -- ) - #2018 DEO + DEOkr #01 SUB DUP ?&>pad &>fill ( length i -- ) - ANDk #2018 DEOk SWP ROT ?{ #0a ORA } - SWP DEO - INC ADDk STHkr LTH ?&>fill - POP2 #0a18 DEO + ANDk DUP2r ?{ POP2r ORA2kr } DEOr DEOkr + INC ADDk ,&size LDR LTH ?&>fill + POP2 OVR2r DEOr #01 SUB INCk ?&>ver - POP POPr BRK + POP POP2r POP2r BRK