Mindustry is a tower-defense type of game, now with added Logic. Logic is a programming language, but it is very low-level. It is more akin to assembly than high-level language.

Mindcode is a high-level language that compiles down to Mindustry Logic. Mindcode includes higher-level constructs, such as expressions, user-defined functions, control statements, or "direct" memory access.

Mindcode now comes with significantly improved code generation, including data flow analysis, loop unrolling and function inlining; for a list of recent changes, see changelog.

Go ahead and try the following samples, then write your own!

38 lines of code

47 lines of code

Start with a new script

Bug reports, suggestions and questions are welcome at the project page.

  • 61 instructions before optimizations.
  • 10 instructions eliminated by Dead Code Elimination (4 iterations).
  • 1 instructions eliminated by Jump Normalization (3 iterations).
  • 2 instructions eliminated by Jump Optimization (3 iterations).
  • 1 instructions eliminated by Single Step Elimination (4 iterations).
  • 47 instructions after optimizations.
  • Performance: parsed in 14 ms, compiled in 4 ms, optimized in 8 ms.