Skip to content

The interpreter library used in the Hack'n'Leap game.

License

Notifications You must be signed in to change notification settings

Hack-n-Leap/interpreter

Repository files navigation

Contributors Commit Activity Stars Issues License

Hack'n'Leap LOGO

Hack'n'Leap Interpreter

About the project

Hack'n'Leap's interpreter is the library used in the game of the same name to enable players to code their own functions. This interpreter supports fairly basic pseudo-code instructions.

Use

How to use ?

  1. Build the solution
  2. Import the .dll file as a reference in your project
  3. Import the library in your code using using InterpreterLib;
  4. You can now use the library !

Sample use

using InterpreterLib;
using System.Text;

public class Program
{
    static void Main(string[] args)
    {
        string line;
        StringBuilder stringBuilder = new StringBuilder();

        Console.Clear();
        Console.Title = "Interpreter";
        Console.WriteLine("Code :");
        
        while (!string.IsNullOrWhiteSpace(line = Console.ReadLine())) { stringBuilder.AppendLine(line); }

        string myCode = stringBuilder.ToString();
        Interpreter myInterpreter = new Interpreter();

        Console.WriteLine("Exit :");
        myInterpreter.EvaluateCode(myCode);
    }
}

Contributing

We welcome contributions from everyone. If you would like to contribute, please follow the guide below :

  1. Fork the Project.
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature).
  3. Commit your Changes (git commit -m 'Add some AmazingFeature').
  4. Push to the Branch (git push origin feature/AmazingFeature).
  5. Open a pull request.

License

This project is distribued under the MIT license.

About

The interpreter library used in the Hack'n'Leap game.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages