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

@ -235,7 +235,7 @@ function Library (ronin) {
this.sqrt = Math.sqrt // calculate the square root
this.sq = (a) => { // calculate the square
return a * a;
return a * a
}
this.PI = Math.PI

View File

@ -152,7 +152,7 @@ function Lisp (lib = {}, includes = []) {
}
const tokenize = function (input) {
const i = input.replace(/^\;.*\n?/gm, '').replace('λ', 'lambda ').split('"')
const i = input.replace(/^\;.*\n?/gm, '').replace(/λ /g, 'lambda ').split('"')
return i.map(function (x, i) {
return i % 2 === 0
? x.replace(/\(/g, ' ( ')

View File

@ -1,14 +0,0 @@
; gradients
(clear)
(fill
(svg "M405,15 L405,15 L150,150 L195,90 L240,135 L120,195 L75,90 L135,165 L120,225 L90,240 L60,210 L90,150 L255,180 L285,180 L285,165 ")
(gradient
(0 -50 600 175)
("red" "orange" "blue" "green")))
(stroke
(svg "M255,60 L255,60 L135,180 L75,60 L195,210 L120,225 L105,225 L165,255 L225,195 L255,135 L285,150") 1
(gradient
(50 0 180 0)
("black" "white" "blue" "green")))

View File

@ -0,0 +1,12 @@
; gradients
(clear)
(fill
(svg 0 0 "M405,15 L405,15 L150,150 L195,90 L240,135 L120,195 L75,90 L135,165 L120,225 L90,240 L60,210 L90,150 L255,180 L285,180 L285,165 ")
(gradient
(0 -50 600 175)
("red" "orange" "blue" "green")))
(stroke
(svg 0 0 "M255,60 L255,60 L135,180 L75,60 L195,210 L120,225 L105,225 L165,255 L225,195 L255,135 L285,150") 1
(gradient
(50 0 180 0)
("black" "white" "blue" "green")))

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)

View File

@ -1,5 +1,5 @@
; theme
; reads color from the theme.
(clear)
(def col
(λ