Posted August 01, 2024 by Tom Mulgrew
A small update to add support for array based for loops.
The syntax is similar to C++:
for (type elem : array) { [do something with "elem"] }
For example:
struct Ball { int x, y, col; } Ball[] balls = new Ball[0]; for (int i = 0; i < 10; i++) { balls.add(new Ball { x = rnd() * 320, y = rnd() * 240, col = i + 1 }); } for (Ball ball : balls) { color(ball.col); circfill(ball.x, ball.y, 12); } flip();
Also fixed a bug where intellisense would stop working if you delete a .mot file in vscode.