This project is dead and files on the git hub may not be accurate.


Cobra Interpreter

Cobra is a custom Python-based interpreter designed for executing scripts that interact with the operating system, play sounds, and perform batch processing. It allows users to run .txt scripts or batch files, execute OS-level commands, and control sound playback.

Features

Table of Contents

  1. Installation
  2. Syntax Overview
  3. Commands
  4. Running the Interpreter
  5. Settings
  6. License

Installation

To install and run Cobra, make sure you have Python installed. Then, follow these steps:

  1. Clone the repository: bash git clone https://github.com/Mos6502DIP/The-Cobra-Project.git cd The-Cobra-Project

Syntax Overview

Cobra provides a simple set of commands to execute tasks. Below is an overview of some key commands:

1. Printing

2. Variables

3. Conditionals

4. Sound Playback

5. OS Commands


Commands

| Command | Description | | -------------- | --------------------------------------------------- | | print() | Prints a string or variable value. | | goto() | Jumps to a specified line in the script. | | var=.myvar() | Assigns a value to a variable. | | var+.myvar() | Adds a value to an existing variable. | | varI. | Prompts for user input and stores it in a variable. | | playsound() | Plays a sound using the playsound library. | | pause() | Pauses execution for a given number of seconds. | | os. | Executes an OS-level command. | | ep | Ends an if block (conditional statement). |


Running the Interpreter

You can run a script by providing the filename as an argument to launcher.py:

bash python launcher.py <script_filename>

For example, to run a script called example.txt:

bash python launcher.py example.txt

You can also execute batch files (.cbrbat), which allows running multiple commands:

bash python launcher.py <batch_file>.cbrbat


Settings

The interpreter uses a Settings.txt file to manage configuration options. Some settings include:


License

This project is licensed under the MIT License - see the LICENSE file for details.


Images