From 88d9e3b2e3979ef317815b8c6cd702abbded2bb9 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sun, 3 Nov 2024 17:32:43 -0500 Subject: [PATCH] Remove loop-based gons, leaving only recursive --- gons_recur.ld | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/gons_recur.ld b/gons_recur.ld index 58170e5..7e9be0a 100644 --- a/gons_recur.ld +++ b/gons_recur.ld @@ -10,25 +10,6 @@ fn randcolor () -> (random (0, 255), random (0, 255), random (0, 255)) fn pen_randcolor! () -> pencolor! (randcolor ()) -fn spiral_gon! (iter) -> { - loop (30, 0, colors :lime) with (size, times, color) -> { - let randcolor = (random(0, 255), random(0, 255), random (0, 255)) - let newcolor = if eq? (color, colors :lime) - then colors :fuchsia - else colors :lime - if lt? (times, iter) - then { - pen_randcolor! () - ngon! (5, size) - right! (inv (iter)) - recur (add (size, 1), inc (times), newcolor) - } - else :ok - } -} - -& spiral_gon! (100) - fn spiral_gonr! { (iter) -> spiral_gonr! (iter, iter, 30) (_, 0, _) -> :ok @@ -39,6 +20,4 @@ fn spiral_gonr! { spiral_gonr! (iter, dec (times), inc (size)) } } -goto! (37, 37) spiral_gonr! (100) -print! (turtle_state())