This is a small transpiler from a dialect of the [BASIC](https://en.wikipedia.org/wiki/BASIC) language, "MinBasic" (also known as `mbas`), to [Mindustry](https://github.com/Anuken/Mindustry/)'s [logic system](https://www.reddit.com/r/Mindustry/comments/kfea1e/an_overly_indepth_logic_guide/) (also known as `mlog`).
*Write simple code for complex logic in [Mindustry](https://github.com/Anuken/Mindustry/)*
```basic
LET time = 0
WHILE true
time = time + 1
reactor1.enabled = time % 3 == 0
reactor2.enabled = time % 3 == 1
reactor3.enabled = time % 3 == 2
WAIT(1)
WEND
```
![Output of the above code block](./assets/blinking-reactors.gif)
`basic-to-mindustry` is a small transpiler from a dialect of the [BASIC](https://en.wikipedia.org/wiki/BASIC) language, "MinBasic" (also known as `mbas`), to [Mindustry](https://github.com/Anuken/Mindustry/)'s [logic system](https://www.reddit.com/r/Mindustry/comments/kfea1e/an_overly_indepth_logic_guide/) (also known as `mlog`).
Basic is chosen as the source language as it already contains jumps (which mindustry heavily relies on), while allowing for some higher-order constructs like conditions, loops and functions.
## Installation and running
To use this project, start by cloning this git repository:
You will need an installation of the Rust compiler, which you can quickly get from [rustup.rs](https://rustup.rs/).
Then, simply run the following command to install the MinBasic compiler: