-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
psutil and requests libraries needs to be installed separately.
You can also run setup.py.
Things to know :
This program works line per line, which means that it is ONE INSTRUCTION PER LINE.
You can also use a comma (;) to mark the end of the line, but it is not required.
This can be modified through the startup.ini file or the console.
This language also does not use quotes (").
Plugin for Sublime Text 3 (Syntax highlighting) disponible in the wiki. Not remade for current version
Plugin for ini file also disponible in the wiki.
Before everything, open the console (file console.py). Type help inside if required.
Help for the console is not provided in the documentation.
You can comment line per line with # or //.
Multiline comments are done with /* and */.
You can use the print method to send something in the console.
EXAMPLE 1 :
Input :
print Hello
Output :
Hello
You can also inject variables inside it by typing {<var_name>}.
In practise, if we have a string variable named "pseudo" containing the value "TheAssassin", we can get this :
EXAMPLE 2 :
Input :
print Hello, {pseudo} !
Output :
Hello, TheAssassin !
It works with every type of variable.
Otherwise, you can use <equation> to make an equation.
With a variable number equals to ten, that we want to multiply by two :
Input :
print 10 multiplied by 2 equals <{number}*2>
Output :
10 multiplied by 2 equals 20
Variables have to be defined clearly.
It follows the form var <var_name> = <value>.
Change for 2.0 : No longer variable types
<var_name> The variable name. Note that two variables with different types can have the same name, even if not recommended.
It depends :- If integer, it is simply a whole number.
- If float, as written earlier, the whole part and the decimal part are seprated by a dot (
.). - If string, it is as many characters, symbols, and digits as you want.
- If boolean, it is
trueorfalse. Every type of lower and upper case is accepted.
SPECIAL VALUES :
-
It can also be special values : you can meet the
inputmethod. It asks the user to type something in the console. Syntax :input <text>is the text that will be asked to the user. You can also put\nto create a newline. -
You can also do mathematical equations to affect variables. They can also contain variables. Syntax :
<equation> -
You can also define them as random. Therefore, type
random <first_number>, [second_number]. If both numbers are given, the result will be a random number between them. Else, it will be a random number between 0 and <first_number>. You can also replace numbers by variables.
EXAMPLE 1 :
We want to create a variable "pseudo" containing "TheAssassin".
Input :
var pseudo = TheAssassin
To use it :
{pseudo}
EXAMPLE 2 :
We want to ask the user for his pseudo :
Input :
var pseudo = input(What is your pseudo ? )
EXAMPLE 3 :
We want to calculate 3*(6**2) and store it into a variable "operation".
Input :
var operation = 3*(6**2)
EXAMPLE 4 :
We have a variable "age" containing the value 18. We want to multiply it by 2 (don't ask why xD)
And then store it into "double"
Input :
var double = 2*{age}
EXAMPLE 5 :
We ask the user for his age and we multiply it by 5.
Input :
int age = input What is your age ? int new_age = 2*{age} print Your new age is now {age} xD !
Output (for this example, age equals 18) :
Your new age is now 90 xD !
EXAMPLE 6 :
You want a random number between 1 and 50 for the Lotto.
Input :
var Lotto = random 1, 50
The if function is made to check if a condition is true or false.
If true, it will execute the following instructions block ; if false, two cases :
- There is nothing after : the program won't run the instructions block.
- It is an
else: the program will run the instruction block after the else.
No elseif at the moment.
Syntax :
if <condition>
The condition can contain as many variables as you want, and is with these operators :
-
==: compares if equal -
!=: compares if different -
<: compares if inferior -
>: compares if superior -
<=: compares if inferior or equal -
>=: compares if superior or equal -
in: compares if a string is inside another
You can join more by typing :
-
and, if so, it will be true only if all conditions are true. -
or, if so, it will be true if at least one of the conditions is true.
The <instructions> can be whatever, but they need to have one more TAB than the if.
You can loop for a certain amount of times using a for loop.
Syntax :
for <variable_name> <min> <max>
<instructions>
endfor
Both end for and endfor are possible.
<variable_name> should be a name for a variable. This variable is going to be created for the loop, usable inside, and destroyed after.
It will be incremented every looping.
is the default value of <variable_name>
is the maximum value of the variable.
Example :
Input :
for i 3 5
print Hey ! It's the {i} looping !
endfor
print And now I'm out...
Output :
Hey ! It's the 3 looping !
Hey ! It's the 4 looping !
Hey ! It's the 5 looping !
And now I'm out...
Notice you can place an if statement inside, but no other loop.
You can pause for a certain amount of time using pause method.
Syntax : pause
Can be an integer value, a float value, or a variable.
If you use a variable, the syntax is `pause {<variable_name>}.
You can delete an unnecessary variable and free memory with this instruction.
Simply type deletevar <variable_name> to do so.
Example :
deletevar Test will delete var Test.
For further detail, go to the wiki page.
You can download and install libs through the console commands.
Type lib install <lib> to install one and lib update <lib> to update one.
To use one, declare at the beginning of your program $use: <lib>.
Actual disponble libs :
- String : basic string manipulations
- Wait_until_user_input : gives a new funtion to wait until user input.
- Run_file : allows you to run another ACPL code file.
- Os : allow you to run a system command.
- Colors : Allows you to put colors in your prints or variables ONLY IF the
use-colorsin thestartup.acpl-iniis set toTrue. - Files : Basic file manipulations. Does not work very well