a full-circle rainbow

This commit is contained in:
Kartik K. Agaram 2021-05-08 07:58:56 -07:00
parent 1adc904ef3
commit 665b1e8f07
2 changed files with 30 additions and 3 deletions

View File

@ -91,8 +91,35 @@
(+ 1 (* 2 (set x (+ x 1))))))
)
(set continue (< x 0)))))))))])
(ring . [(def ring (fn(screen cx cy r w clr)
(let rmax (+ r w)
(while (< r rmax)
(brcircle screen cx cy r clr)
(set r (+ r 1))))))])
(circle_rainbow . [(def circle_rainbow (fn(screen c w)
(let cx (/ (width screen) 2)
(let cy (/ (height screen) 2)
(ring screen cx cy c w 37)
(set c (+ c w))
(ring screen cx cy c w 33)
(set c (+ c w))
(ring screen cx cy c w 55)
(set c (+ c w))
(ring screen cx cy c w 52)
(set c (+ c w))
(ring screen cx cy c w 47)
(set c (+ c w))
(ring screen cx cy c w 45)
(set c (+ c w))
(ring screen cx cy c w 44)
(set c (+ c w))
(ring screen cx cy c w 42)
(set c (+ c w))
(ring screen cx cy c w 41)
(set c (+ c w))
(ring screen cx cy c w 40)))))])
(main . [(def main (fn (screen keyboard)
(chessboard screen 16)))])
(circle_rainbow screen 80 10)))])
))
(sandbox . (brcircle screen 14 8 6 2))
(sandbox . (circle_rainbow screen 8 1))
)

View File

@ -482,7 +482,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han
compare left-out, 0
{
break-if-!=
abort "error in eval-list"
abort "there was some error (likely in syntax): eval-list"
}
}
#