A very simple to learn programming language
- print - used to display text(no need for double quotes or paranthesis)
- jump - used to execute a line.
- start - used to begin main block of code (this is required)
- end - used to end the main block of code (this is required)
- loop - used to execute a line a given number of times
- add - used to add two numbers
- sub - used to subtract two numbers
- mul - used to multiply two values
- div - used to divide two numbers
- var - used to create a variable
- assign - used to assign or change a variable value
- inc - used to increment an integer variable
- import - used to import a file (still in testing!)
- exec - used to run a line in an imported file (still in testing)
- input - used to recive data from the user
- labels - it is equivalent to a python function
To run a .ci file just download the interpreter i.e cherryscript.py.
make a .ci file in the same folder as the interpreter
run the following command in the terminal(linux) or command prompt(windows)
For windows
python3.exe cherryscript.py "your program.ci"
without quotes of course
For linux
python3 cherryscript.py "your program.ci"
without quotes of course
You can use '// ' for comments
Variables always start with a '$'
Dont forget to specify int for numbers or str for words
You can store the result of a math command in a variable by putting a variable's name after it
loop can be used to run lines after 'end'
Note:choose cherryscript-rolling to try out the latest features
## Syntaxprint *text*
you can also place variables in between normal text
jump *line_number*
line_number is the actual line number in your text editor
start
just put it where you want to start the main code
end
use it to end main code section
loop *start_line_number* *end_line_number* *iterations*
iterations is the number of times the code between start line numbers and end line numbers is executed
add *first number* *second number* *variable(optional)*
if variable is not given then the result is printed by default
if variable is given then the result is stored in it
sub *first number* *second number* *variable(optional)*
if variable is not given then the result is printed
if variable is given then the result is stored in it
mul *first number* *second number* *optional variable*
similar to add and sub but it does multiplication
dv *first number* *second number* *optional variable*
similar to add , sub and mul bit does division
var *variable type* *variable name* *(optional)value*
variable type has two values str for string and int for integer
variable names should always start with a $
for example $num
used to assign a value to a variable during execution
assign *variable name* *value*
used to increment an integer type variable by a specified value
inc *variable name* *value*
note that value should always be an integer
used to import a .ci file
import *file name*
used to run a line in an imported file
exec *line number*
lables are like the cherryscript equivalent of functions
you can declare a new label before start
the synatx is as below
:lable_name
your code
;
every lable is ended with a ;
any label can be executed by just writing the label name without : in between start and end
or executed using either loop or jump