Extended Mindustry logic and its compiler
Project description
MlogExtended
Mindustry logic with more instructions. Compiling to vanilla Mindustry logic IS supported. NOT A MOD.
Features
- Tag support
- Conditional jump to tags using
xjump
instructions - Compile to vanilla Mindustry logic
Usage
python3 -m mlog_extended <input_file> <output_file>
Seepython3 -m mlog_extended --help
for more information
Tag
Looks like :Tag1
, :snake_case
, :我能吞下玻璃而不伤身体
, etc.
- A unicode string on a SEPARATED line, starting with colon
:
, can contain leading whitespaces before:
- Points to next instruction
- has a name. e.g. The name of
:named_tag_1
isnamed_tag_1
- Tag name should not contain whitespaces
- Multiple tags can point to one instruction
set x 0
:Tag1
:Tag2
op add x x 1
:Tag3
xjump
- Similar to vanilla
jump
instruction - But
xjump
jump to tags
set i 0
:DoWhileLoop
op add i i 1
xjump DoWhileLoop lessThan i 10
print i
xjump NotTooFar lessThanEq @thisx 10000
print ". Oops, I am too far away!"
:NotTooFar
printflush message1
jump-if
- Similar to
xjump
instruction - Use C-style operators like
==
!=
and===
, etc.
set i 0
:DoWhileLoop
op add i i 1
jump-if DoWhileLoop i <= 10
print i
jump-if NotTooFar @thisx <= 10000
print ". Oops, I am too far away!"
:NotTooFar
printflush message1
xlet
- C-Sytle variable assignment, but very limited.
- Replaces vanilla
set
andop
instructions. - ONLY unary and binary operators are supported.
xlet a = b
xlet a1 = b + c
xlet a1 = 2 ** 8
xlet a2 min c d
xlet a2 =~ x
xlet a2 floor x
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mlog_extended-0.0.2.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for mlog_extended-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef307ca6794272295cad6e985e8a57051432d810528202d6da9213f7c16010f |
|
MD5 | f7e08cf8c3a9dee02f99d2a687f85650 |
|
BLAKE2b-256 | 41a321f07fe2cf2ee0f80736568cd134572667621868578139475a49a752c39e |