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:

34 lines of code

71 lines of code

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

  • Main file: number of reported ambiguities: 8
  • 77 instructions before optimizations.
  • 3 instructions eliminated by Temp Variables Elimination.
  • 7 instructions eliminated by Dead Code Elimination (4 iterations).
  • 2 instructions eliminated by Jump Normalization (3 iterations).
  • 2 instructions eliminated by Jump Optimization (3 iterations).
  • 2 instructions eliminated by Single Step Elimination (4 iterations).
  • 10 instructions eliminated by Data Flow Optimization (3 passes, 9 iterations).
  • 23 instructions added by Function Inlining (4 iterations).
  • 4 function calls inlined by Function Inlining.
  • 4 instructions updated by JumpThreading.
  • 4 instructions eliminated by Unreachable Code Elimination.
  • 70 instructions after optimizations.
  • Performance: parsed in 7 ms, compiled in 5 ms, optimized in 41 ms.