Updated docs
This commit is contained in:
parent
42e894ef38
commit
ecd6c46f40
29
examples/projects/lambda.lisp
Normal file
29
examples/projects/lambda.lisp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
(resize 600 200)
|
||||||
|
|
||||||
|
(clear)
|
||||||
|
|
||||||
|
(def colors
|
||||||
|
("#72dec2" "#316067"))
|
||||||
|
|
||||||
|
(def picked-colors
|
||||||
|
("#000" "#000" "#000" "#000" "#000" "#000" "#000" "#000" "#000"))
|
||||||
|
|
||||||
|
(fill
|
||||||
|
(rect 0 0 600 200)
|
||||||
|
(gradient
|
||||||
|
(guide
|
||||||
|
(line 0 100 600 100)) colors))
|
||||||
|
|
||||||
|
(each picked-colors
|
||||||
|
(λ
|
||||||
|
(color id)
|
||||||
|
(
|
||||||
|
(set picked-colors id
|
||||||
|
(pick
|
||||||
|
(guide
|
||||||
|
(pos
|
||||||
|
(mul id
|
||||||
|
(div 600 9)) 100)))))))
|
||||||
|
|
||||||
|
(echo
|
||||||
|
(get picked-colors:1 "hex"))
|
@ -1203,7 +1203,7 @@ function Library (client) {
|
|||||||
this.each = (arr, fn) => { // Run a function for each element in a list.
|
this.each = (arr, fn) => { // Run a function for each element in a list.
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
const arg = arr[i]
|
const arg = arr[i]
|
||||||
fn(arg)
|
fn(arg,i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.map = (arr, fn) => { // Run a function on each element in a list.
|
this.map = (arr, fn) => { // Run a function on each element in a list.
|
||||||
|
@ -416,7 +416,7 @@ function Library (client) {
|
|||||||
this.each = (arr, fn) => { // Run a function for each element in a list.
|
this.each = (arr, fn) => { // Run a function for each element in a list.
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
const arg = arr[i]
|
const arg = arr[i]
|
||||||
fn(arg)
|
fn(arg,i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user