The Tho Interpreter Challenge is an exciting task to develop a Python program that acts as an interpreter for the Tho Programming Language. This minimalistic scripting language focuses on performing arithmetic operations on floating-point numbers using a single register R.
- Simple command-based syntax to perform basic arithmetic operations.
- Interactive commands for user input and output.
- Supports operations such as addition, subtraction, multiplication, and division.
- Minimalistic design to encourage learning and experimentation.
The Tho interpreter processes commands line by line from a script file. Each command manipulates the value in the single register R or interacts with the user. Key commands include:
- ASK: Prompts the user for input and stores it as a named constant.
- TELL: Outputs the current value of the register
R. - ADD: Adds a value or constant to
R. - SUB: Subtracts a value or constant from
R. - MUL: Multiplies
Rby a value or constant. - DIV: Divides
Rby a value or constant.
- Python 3.7 or higher.
- Basic knowledge of Python programming, with understanding of the CLI.
- Clone this repository:
git clone https://github.com/Hi-kue/tho-interpreter.git
- Navigate to the project directory:
cd tho-interpreter - Ensure you have Python installed by running:
python --version | py --version | py3 --version | python3 --version
- Create a Tho script file (e.g.,
script.txt) with the desired commands in the/checks/directory. - Make sure you install all dependencies by running:
pip install -r requirements.txt
- Run the interpreter by executing the
main.pyscript:python main.py
- Follow the prompts to select the Tho script file to interpret.
- The interpreter will parse and execute the commands in the script file.
- The output will be displayed in the console.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.