Skip to content

Simple Script is a basic command language that currently supports the saving and accessing of variables, conditional statements and loops, that could be used as a foundation for creating your own programming language

License

Notifications You must be signed in to change notification settings

Ammar-Raneez/Simple_Script

Repository files navigation

SimpleScript v1.0.0 SimpleScript

SimpleScript is a basic command language that supports saving and accessing of variables, conditional statements and loops.

Please Note

Python version 3 will be required to run

Quick Start

On your command line enter

python main.py

Features

  • Ability to save and load a variable
  • The variable can take mathematical expressions as a value, which will be evaluated first
  • Error logs and tracebacks pointing out the location at which the error was caused

Accepted Commands

To save a variable

SAVE

To access a variable

SHOW

Examples

SAVE A 10
10

SHOW A
10

SAVE A 10*(10+5)
150

SAVE B 10^2
100

SAVE C 2 == 2 AND 4 == 5
0

SAVE D 2 == 2 AND 5 == 5
1

SAVE E IF 2==5 THEN 2 ELIF 3==5 THEN 3 ELSE 5
5

SAVE F 10+5
15

SAVE G F + 5
20

SHOW A
150

SHOW B
100

SHOW C
0

SHOW D
1

SHOW E
5

SHOW F
15

SHOW G
20

SAVE A 1
1
FOR i=1 TO 6 THEN SAVE A A*i
SHOW A
120

SAVE A 1
1
FOR i=5 TO 0 STEP -1 THEN SAVE A A*i
SHOW A
120

SAVE A 1
1
WHILE A < 50 THEN SAVE A A+1
SHOW A
50

SAVEA 10
Invalid Syntax: Expected Keyword, '+', '-' or '('
File <stdin>, line 1

SAVEA 10
^^^^^^^^

SAVE A
Invalid Syntax: Expected Keyword, '+', '-' or '('
File <stdin>, line 1

SAVE A
      ^
      
SHOW C
Traceback (most recent call last):
  File <stdin>, line 1, in <simplescript>
Runtime Error: 'c' is not defined

SHOW C

Repl

https://replit.com/@ammarraneez/SimpleScript

About

Simple Script is a basic command language that currently supports the saving and accessing of variables, conditional statements and loops, that could be used as a foundation for creating your own programming language

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages