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.2.4 constants and parameter default values60 days ago
- v1.2.3 mousewheel() and minor fixes77 days ago
- v1.2.2 variable scoping and web export fix89 days ago
- v1.2.0 - Intellisense releaseJul 28, 2024
- Windows export fixApr 18, 2024
- v1.1.0Feb 18, 2024
- v1.0.2Jan 21, 2024
- MotC 1.0.1 (fullscreen mode)Dec 31, 2023
- MotC 1.0 released!Dec 30, 2023
Leave a comment
Log in with itch.io to leave a comment.