Mindcode is a high-level language that compiles down to Mindustry Logic - mlog. Mindcode includes higher-level constructs, such as expressions, user-defined functions and control statements. Here are some examples to give you an idea how to use Mindcode:

133 lines of code

151 lines of code

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

  • Number of reported ambiguities: 17
  • 277 instructions before optimizations.
  • 23 instructions eliminated by Temp Variables Elimination.
  • 23 instructions eliminated by Dead Code Elimination (4 iterations).
  • 3 instructions eliminated by Jump Normalization (2 passes, 4 iterations).
  • 12 instructions eliminated by Jump Optimization (4 iterations).
  • 13 instructions eliminated by Single Step Elimination (3 passes, 7 iterations).
  • 3 instructions eliminated by Expression Optimization (3 iterations).
  • 2 instructions eliminated by If Expression Optimization (3 iterations).
  • 34 instructions eliminated by Data Flow Optimization (4 passes, 17 iterations).
  • 1 loops improved by Loop Hoisting.
  • 2 instructions added by Loop Optimization (3 iterations).
  • 4 loops improved by Loop Optimization.
  • 6 instructions eliminated by Loop Unrolling (9 iterations).
  • 3 loops unrolled by Loop Unrolling.
  • 4 instructions eliminated by Function Inlining (9 iterations).
  • 5 function calls inlined by Function Inlining.
  • 2 instructions updated by JumpThreading.
  • 2 instructions eliminated by Unreachable Code Elimination.
  • 4 instructions eliminated by Print Merging.
  • 150 instructions after optimizations.
  • Performance: parsed in 12 ms, compiled in 2 ms, optimized in 103 ms.