Skip to main content

MindustryCompiler

a langage that compile to mindustry asm code,

What's mindustry asm ? Here is a nice starting guide with in game screenshots: How To Use Procesors in 6.0

The language created here is a superset of mindustry code

here's the website to show features in actions and compile your code

features

  • all mindustry asm code are valide as it

  • jump to a reference:

    ...
    jump bottom always true true  <--- jump to #ref bottom
    ...
    #ref bottom  <--- set ref anywhere
    ...
    
  • comments:

    // this is a comment
    
    #ref loop // another comment after some blank lines
    
  • improve jump conition:

    jump loop  // <--- jump loop always true true
    jump inf 2 < 4  // <--- jump inf lowerThan 2 4
    
    // ==, ===, !=, >, >=, <, <=, ---> equal, notEqual, greaterThan, ...
    

You could check files here to see the difference from the same programme that compile to the same mindustry asm

  • if else, else if condition:

    if 2 < 4
        print "2 < 4"
    else if 2 == 1
        print "2 == 1"
    
    elif 2 === 2  // "elif" is equivalent to "else if"
        print "2 === 2"
    
    else
        print "else"
    
  • function:

    add(a, b)
        add result a b
        return result
    
    x = 0
    x = add(x, 2)
    
  • module:

    import time
    
    time.wait(2)  // wait 2 secondes
    
  • static for loop:

    import msg
    
    set message message1
    
    for x, y in [(1, 2), (4, 3)]
        if x > y
            print "x : "
            print x
            print " higher than: "
            msg.printAndWait(y, message)
    
  • look files here for some code exemple that I use

coming soon

  • afectation a = 1 and simple operation +, -, /, *, ...

  • operation += -=

  • improve if, if var, if not var, and / or

  • fill empty args of ASM lines (ucontrol itemDrop store 800 0 0 0 -> ucontrol itemDrop store 800)

current usage

  • compile a file :

    mindc fileName
    

    exemple, in this folder:

    mindc tests/identicalCode/4-improveJump.code
    
  • get the result in clipboard to just past it in mindustry :

    mindc tests/identicalCode/4-improveJump.code --ctrlC
    
  • run interactive to play with it :

    mindc --interactive
    

Installation

you need python to run this software

  • check that you have it

    type in your shell/terminal :

    python3 --version
    

    must give you something like: Python 3._._

  • if you don't have it, install it :

    you could dowload python from here

install mindustry compiler

python3 -m pip install MindustryCompiler

run it

mindc

Metadata

Release files for MindustryCompiler 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for MindustryCompiler 2.1
File Interpreter ABI Platform
MindustryCompiler-2.1-py3-none-any.whl Python 3 none any Details

Release files / MindustryCompiler-2.1-py3-none-any.whl

Download URL MindustryCompiler-2.1-py3-none-any.whl
Size 75.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b29a6b7759581380bf2e87f85942702b3ca0bff255b371de32b17e7838badcb
BLAKE2b-256 checksum
How to use checksums
92960994a9b332af0fc5a3d9b054be0266019804cb06378350dac67e66b50abd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

2.1 This release

1 release file

2.0

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.0

1 release file

0.8

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page