v1.2.1 add support for array based for loops
MotC » Devlog
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.
Files
motc-1.2.1.zip 4.6 MB
Aug 01, 2024
Get MotC
Download NowName your own price
MotC
Retro game development tool
| Status | Released |
| Category | Tool |
| Author | Tom Mulgrew |
| Tags | compiler, development, Retro, tool |
More posts
- v1.3.4 reliability and rumble7 days ago
- MotC v1.3.3 released21 days ago
- v1.3.2 bug fix release (with correct version number!)Apr 18, 2025
- v1.3.1 performance improvementsJan 16, 2025
- v1.3.0 with export to Raspberry PiJan 12, 2025
- v1.2.5Dec 08, 2024
- v1.2.4 constants and parameter default valuesSep 17, 2024
- v1.2.3 mousewheel() and minor fixesAug 31, 2024
- v1.2.2 variable scoping and web export fixAug 19, 2024
Leave a comment
Log in with itch.io to leave a comment.