This commit is contained in:
Kartik K. Agaram 2021-06-05 18:04:05 -07:00
parent 3ac99829c7
commit b012fba1bc
1 changed files with 12 additions and 16 deletions

View File

@ -59,9 +59,8 @@
(set c (key keyboard))))
str))])
(fill_rect . [(def (fill_rect screen x1 y1 x2 y2 color)
(while (< y1 y2)
(hline1 screen y1 x1 x2 color)
(++ y1)))])
(for y y1 (< y y2) (++ y)
(hline1 screen y x1 x2 color)))])
(chessboard_row . [(def (chessboard_row screen px y x xmax)
(while (< x xmax)
(fill_rect screen
@ -72,12 +71,10 @@
(clear screen)
(let xmax (width screen)
(let ymax (height screen)
(let y 0
(while (< y ymax)
(for y 0 (< y ymax) (+= y px)
(chessboard_row screen px y 0 xmax)
(+= y px)
(chessboard_row screen px y px xmax)
(+= y px))))))])
(chessboard_row screen px y px xmax)))))])
(circle . [(def (circle screen cx cy r clr)
(let x (- 0 r)
(let y 0
@ -98,11 +95,9 @@
(+= err
(+ 1 (* 2 x))))
(set continue (< x 0))))))))])
(ring . [(def (ring screen cx cy r w clr)
(let rmax (+ r w)
(while (< r rmax)
(circle screen cx cy r clr)
(++ r))))])
(ring . [(def (ring screen cx cy r0 w clr)
(for r r0 (< r (+ r0 w)) (++ r)
(circle screen cx cy r clr)))])
(circle_rainbow . [(def (circle_rainbow scr cx cy r w)
(ring scr cx cy r w 37)
(+= r w)
@ -123,12 +118,13 @@
(ring scr cx cy r w 41)
(+= r w)
(ring scr cx cy r w 40))])
(bowboard . [(def (bowboard screen side)
(bowboard . [(def (bowboard screen r)
(let xmax (width screen)
(let ymax (height screen)
(for y side (< y ymax) (+= y (* 2 side))
(for x side (< x xmax) (+= x (* 2 side))
(circle_rainbow screen x y (- side 100) 10))))))])
(let side (* 2 r)
(for y r (< y ymax) (+= y side)
(for x r (< x xmax) (+= x side)
(circle_rainbow screen x y (- r 100) 10)))))))])
(main . [(def (main screen keyboard)
(circle_rainbow screen 90 90 8 1))])
))