Fixed issue with Lamda

This commit is contained in:
Devine Lu Linvega
2019-07-24 09:31:41 +09:00
parent 6785286118
commit 0294c04858
7 changed files with 44 additions and 46 deletions

View File

@@ -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
View 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))))))