Fixed issue with Lamda
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
; animated recusive spiral
|
||||
; by @local_guru
|
||||
|
||||
(clear)
|
||||
(defn rec
|
||||
(v)
|
||||
(if
|
||||
(gt v 0)
|
||||
(
|
||||
(stroke
|
||||
(circle
|
||||
(add 375
|
||||
(mul
|
||||
(cos
|
||||
(add
|
||||
(div v 17)
|
||||
(div
|
||||
(time) 2000)))
|
||||
(div v 2)))
|
||||
(add 300
|
||||
(mul
|
||||
(sin
|
||||
(div v 11))
|
||||
(div v 2)))
|
||||
(div v 2)) 1 "rgba(114,222, 194,0.1)")
|
||||
(rec
|
||||
(sub v 0.3)))))
|
||||
; set false to stop
|
||||
(animate true)
|
||||
(rec 300)
|
||||
; by @local_guru
|
||||
(clear)
|
||||
(defn rec
|
||||
(v)
|
||||
(if
|
||||
(gt v 0)
|
||||
(
|
||||
(stroke
|
||||
(circle
|
||||
(add 375
|
||||
(mul
|
||||
(cos
|
||||
(add
|
||||
(div v 17)
|
||||
(div
|
||||
(time) 2000)))
|
||||
(div v 2)))
|
||||
(add 300
|
||||
(mul
|
||||
(sin
|
||||
(div v 11))
|
||||
(div v 2)))
|
||||
(div v 2)) 1 "rgba
|
||||
(114,222, 194,0.1)")
|
||||
(rec
|
||||
(sub v 0.3)))))
|
||||
; set false to stop
|
||||
(animate true)
|
||||
(rec 300)
|
||||
37
examples/demo/stars.lisp
Normal file
37
examples/demo/stars.lisp
Normal file
@@ -0,0 +1,37 @@
|
||||
; stars
|
||||
(clear)
|
||||
;
|
||||
(defn draw-spoke
|
||||
(cx cy r a)
|
||||
(
|
||||
(stroke
|
||||
(line
|
||||
(pos cx cy)
|
||||
(circle-pos cx cy r a)) 2 "white")))
|
||||
;
|
||||
(defn draw-star
|
||||
(cx cy r c)
|
||||
(
|
||||
(times c
|
||||
(λ
|
||||
(i)
|
||||
(
|
||||
(draw-spoke cx cy r
|
||||
(deg-rad
|
||||
(mul i
|
||||
(div 360 c)))))))))
|
||||
; main
|
||||
(times 100
|
||||
(λ
|
||||
()
|
||||
(
|
||||
(draw-star
|
||||
(random 100
|
||||
(of
|
||||
(frame) :w))
|
||||
(random 100
|
||||
(of
|
||||
(frame) :h))
|
||||
(random 10 100)
|
||||
(floor
|
||||
(random 3 32))))))
|
||||
Reference in New Issue
Block a user