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:

102 lines of code

644 lines of code

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

  • Main file: number of reported ambiguities: 17
  • 184 instructions before optimizations.
  • 24 instructions eliminated by Temp Variables Elimination.
  • 22 instructions eliminated by Dead Code Elimination (4 iterations).
  • 1 instructions eliminated by Jump Normalization (3 iterations).
  • 11 instructions eliminated by Jump Optimization (3 iterations).
  • 9 instructions eliminated by Single Step Elimination (4 iterations).
  • 526 instructions eliminated by Data Flow Optimization (3 passes, 12 iterations).
  • 1 instructions eliminated by Loop Optimization (2 iterations).
  • 5 loops improved by Loop Optimization.
  • 1021 instructions added by Loop Unrolling (6 iterations).
  • 1 loops unrolled by Loop Unrolling.
  • 34 instructions added by Function Inlining (6 iterations).
  • 7 function calls inlined by Function Inlining.
  • 2 instructions eliminated by Jump Straightening (3 iterations).
  • 2 instructions updated by JumpThreading.
  • 643 instructions after optimizations.
  • Performance: parsed in 19 ms, compiled in 6 ms, optimized in 157 ms, run in 29 ms.