From fc6a8bf69f123746e1f8254ef077f8fcff03597c Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 24 Jul 2019 14:17:08 +0900 Subject: [PATCH] Fixed spiral --- examples/demo/spiral.lisp | 42 +++++++++++++++------------------------ 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/examples/demo/spiral.lisp b/examples/demo/spiral.lisp index bcc8c6e..77e8b0a 100644 --- a/examples/demo/spiral.lisp +++ b/examples/demo/spiral.lisp @@ -1,30 +1,20 @@ ; animated recusive spiral ; by @local_guru -(clear) + +; (defn rec (v) - (if - (gt v 0) - ( - (stroke - (circle - (add 375 - (mul - (cos - (add - (div v 17) - (div - (time) 2000))) - (div v 2))) - (add 300 - (mul - (sin - (div v 11)) - (div v 2))) - (div v 2)) 1 "rgba - (114,222, 194,0.1)") - (rec - (sub v 0.3))))) -; set false to stop -(animate true) -(rec 300) \ No newline at end of file + (if (gt v 0) + ((stroke + (circle + (add 375 (mul (cos (add (div v 17) (div (time) 2000))) (div v 2))) + (add 300 (mul (sin (div v 11)) (div v 2))) + (div v 2)) 1 "rgba(114,222, 194,0.1)") + (rec (sub v 0.3))))) +; +(defn redraw () ( + (clear) + (rec 300) +)) +; +(on "animate" redraw) \ No newline at end of file