adds print and map
This commit is contained in:
@@ -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
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))
|
||||
)
|
||||
Reference in New Issue
Block a user