Visit
http://osdoc.cogsci.nl/manual/javascript/pythonic
for the latest documentation
OpenSesame 4.1 will be released soon with many new features and improvements. Take it for a test drive now!
Python-like iterators (pythonic)
The pythonic library provides Python-like functions for iterating over arrays. Available functions are: range(), enumerate(), items(), zip(), and zipLongest().
Example:
Draw a five by five grid of incrementing numbers:
let positions = xy_grid(5, 50)
const cnv = Canvas()
for (const [i, [x, y]] of enumerate(positions)) {
cnv.text({text: i, x: x, y: y})
}
cnv.show()
For an overview, see:
