adds print and map

This commit is contained in:
Quentin Leonetti 2019-07-13 17:58:04 +02:00
parent 0dc0db98a9
commit 805e9ccb28
2 changed files with 16 additions and 0 deletions
desktop/sources/scripts
examples

@ -24,6 +24,14 @@ function Library (ronin) {
// TODO: Closes Ronin
}
this.print = (...args) => {
console.log(...args)
}
this.map = (fn, arr) => {
return arr.map(fn)
}
// Rects
this.pos = (x, y, t = 'pos') => {

8
examples/arrays.lisp Normal file

@ -0,0 +1,8 @@
(print (map (lambda (a) (add a 1)) (1 2 3)))
(
(clear)
(map (lambda (a)
(stroke (rect (mul a 30) 20 50 50) 1 "red"))
(5 10 15 20))
)