about summary refs log tree commit diff stats
path: root/shell/data.limg
diff options
context:
space:
mode:
Diffstat (limited to 'shell/data.limg')
-rw-r--r--shell/data.limg23
1 files changed, 22 insertions, 1 deletions
diff --git a/shell/data.limg b/shell/data.limg
index c61ebe98..534ecd51 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -67,8 +67,29 @@
                        (fill_rect screen x y (+ x px) (+ y px) color)
                        (set x (+ x px))
                        (set x (+ x px)))))
+    (brcircle . (fn () (screen cx cy r color)
+                  ((fn (x y err continue)
+                     (while continue
+                       (pixel screen (- cx x) (+ cy y) color)
+                       (pixel screen (- cx y) (- cy x) color)
+                       (pixel screen (+ cx x) (- cy y) color)
+                       (pixel screen (+ cx y) (+ cy x) color)
+                       (set r err)
+                       (if (<= r y)
+                         (set err (+ err (+ 1 (* 2 (set y (+ y 1))))))
+                         ())
+                       (if (or (> r x) (> err y))
+                         (set err (+ err (+ 1 (* 2 (set x (+ x 1))))))
+                         ())
+                       (set continue (< x 0))
+                       ))
+                    (- 0 r)
+                    0
+                    (- 2 (* 2 r))
+                    1
+                   )))
     (main . (fn () (screen keyboard)
               (chessboard screen 16)))
   ))
-  (sandbox . (+ 1 2))
+  (sandbox . (brcircle screen 5 5 3 12))
 )