Domain-specific programming language made for solving twisting cube puzzles
Project description
CubeLang
CubeLang is a strongly statically typed domain-specific procedural programming language made for solving twisting cube puzzles like Rubik's cubes.
Installation
CubeLang requires Python 3.6 or newer to functions. For the information on how to install Python please refer to the downlaod page.
The easies way to install CubeLang is by using pip. On how to install pip please refer to the manual.
pip install CubeLang
After the installation cubelang
and cubelang-scramble
command line utilities will be available.
Development
In order to develop CubeLang clone this repository and install dependencies.
git clone https://github.com/poletaevvlad/CubeLang.git
cd CubeLang
pip install lark-parser termcolor
pip install -r test_requirements.txt
Tests for the interpreter are located in the test
directory, tests for the example programs are in the test_examples
directory. CubeLang uses pytest for testing.
Examples
There are two example programs written in CubeLang. They are located in the examples
directory of the GitHub repository.
The results of executing example programs are shown bellow.
Beginner's method (3x3x3 cube) @ examples/beginner
Pocket cube (2x2x2 cube) @ examples/pocket-cube
Documentation
You can find the language documentation in the docs
directory in the root of this repositorty.
Documentation consists of the following sections:
Usage @ docs/usage.md
Describes the command line arguments for the interpreter and scrambler utility application
Variables and types @ docs/types.md
Describes how to define a variable, determine it's scope. Lists data types, supported by CubeLang.
Operators @ docs/operators.md
Lists binary and unary operators supported by CubeLang.
Conditions and loops @ docs/statements.md
Shows the syntax of most execution controlling operators: conditions, loops and orient
operator.
Cube turns and rotations @ docs/actions.md
Shows the syntax of cube turning and rotating commands used by the language and some of the interpreter's command line arguments.
Indexing @ docs/indexing.md
Describes how to access sticker colors of a cube.
Standard library @ docs/stdlib.md
A reference for all functions and constants included into the standard library.
License
This software is licensed under MIT license. Please refer to LICENSE of the repository file for more information.
Copyright © Vlad Poletaev, 2019
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.