Git Product home page Git Product logo

mindl's Introduction

MindL Compiler

MindL Compiler is a Python script designed to compile code written in MindL, a custom programming language for the game Mindustry. The script provides features like converting conditional statements, looping structures, and handling various commands specific to the game's logic. It includes a set of utility functions for string manipulation, line searching, and expression evaluation.

Features

  • Compile MindL code into an executable format for Mindustry.
  • Handle conditional expressions and loops (if, while).
  • Provide utility functions for string operations and type checking.
  • Support for Mindustry-specific commands (print, radar, control, sensor, ubind, ucontrol, uradar, ulocate).
  • Debugging feature to set status messages in the compiled output.
  • Command-line interface for specifying input and output files.

Usage

The script can be invoked from the command line with optional arguments to specify the input and output files.

Command-line Arguments

  • -i, --input: Specify the file to compile. Defaults to script.mlx if not provided.
  • -o, --output: Specify the output file. If not provided, the result is printed to stdout.
  • -f, --format: Add line numbers to the output when printing to the console.

Example

python3 main.py -i my_script.mlx -o compiled.txt

This will compile the my_script.mlx file and save the output to compiled.txt.

Dependencies

  • argparse: For parsing command-line options.
  • random: To generate random strings.
  • colorama: For handling console output formatting.

Before running the script, ensure that colorama is installed and the console is configured for proper output.

Contributions

Contributions are welcome. Please feel free to report issues or submit pull requests on the repository.

License

This project is open-sourced under the GPL-3.0 License.

mindl's People

Contributors

cat-125 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.