Fixed elementary desktop script

This commit is contained in:
neauoire
2020-03-28 09:47:58 +09:00
parent 58f504a8f8
commit cf4c82ef4a
3 changed files with 28 additions and 13 deletions

View File

@@ -34,8 +34,7 @@
(sub v 0.3)))))
;
(defn redraw
()
(defn redraw ()
(
(clear)
(rec 300)))

View File

@@ -1,6 +1,10 @@
; stars
(clear)
; times
(defn times
(v f)
(
@@ -9,12 +13,18 @@
(gt v 1)
(times
(sub v 1) f))))
; convert deg to radians
(defn deg-rad
(deg)
(mul deg
(div PI 180)))
; position on a circle from angle
(defn circle-pos
(cx cy r a) {:x
(add cx
@@ -23,7 +33,10 @@
(add cy
(mul r
(sin a)))})
; draw
(defn draw-spoke
(cx cy r a)
(
@@ -33,6 +46,7 @@
(circle-pos cx cy r a))
(:y
(circle-pos cx cy r a))) "white" 2)))
;
(defn draw-star
(cx cy r c)
@@ -45,10 +59,12 @@
(deg-rad
(mul i
(div 360 c)))))))))
; main
(times 100
(λ
()
(λ ()
(
(draw-star
(random 100 frame:w)