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!

11 lines of code

13 lines of code

Start with a new script

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

  • 22 instructions before optimizations.
  • 4 instructions eliminated by Temp Variables Elimination.
  • 2 instructions eliminated by Dead Code Elimination (3 iterations).
  • 2 instructions eliminated by Jump Optimization (3 iterations).
  • 1 instructions eliminated by Single Step Elimination (4 iterations).
  • 1 instructions modified by Loop Optimization (2 iterations).
  • 1 loops improved by Loop Optimization.
  • 13 instructions after optimizations.
  • Performance: parsed in 7 ms, compiled in 2 ms, optimized in 2 ms.