You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Larry Xue e526c13013 added installation 5 years ago
c2logic added functions 5 years ago
examples added installation 5 years ago
include added installation 5 years ago
.clang-format initial commit 5 years ago
.clang-tidy initial commit 5 years ago
.gitignore initial commit 5 years ago
.pylintrc initial commit 5 years ago
.style.yapf initial commit 5 years ago
LICENSE added installation 5 years ago
README.md added installation 5 years ago
compile_flags.txt added installation 5 years ago
mypy.ini initial commit 5 years ago
requirements.txt optimized loops/if and added continue 5 years ago
setup.py added installation 5 years ago

README.md

c2logic

Compiles C code to Mindustry logic. Still in beta, so compiled output may not be fully optimized.

Installation

pip install git+https://github.com/SuperStormer/c2logic

Usage

Run the command line tool using:

c2logic filename -O optimization_level

where filename is a string and optimization_level is an integer.

When developing your script, you can include c2logic/builtins.h located in the python include directory(location depends on system, mine is at ~/.local/include/python3.8/)

See examples for API sample usage.

Documentation

See include/builtins.h for API definitions.

Unsupported Features

  • drawing
  • getlink
  • memory cell read/write
  • actual functions
  • structs
  • enums

Some of these features may be worked around using asm().