-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
898 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,50 @@ | ||
### 3.8 | ||
- Lists | ||
Biggest feature of this update, lists allow to store multiple variables in a single one. | ||
If you use C, it's some sort of dynamically changing array. | ||
|
||
**How to declare a list :** | ||
Type like the following ; | ||
``` | ||
var:list <name> = list [ELEMENT 0] [ELEMENT 1] [ELEMENT 2] | ||
``` | ||
Every element of the list has to be between brackets when you initialize it. | ||
Also, in the example, I created a list containing only 3 elements ; but a list can contain as many as you want. | ||
|
||
**How to add an element at the end of a list :** | ||
Type like the following : | ||
``` | ||
var:list <name> = list.add <content> | ||
``` | ||
The <content> will be appended at the end of the list. | ||
|
||
**How to insert an element at a specific index of the list :** | ||
Type like the following : | ||
``` | ||
var:list <name> = list.insert <index> <content> | ||
``` | ||
*Keep in mind indexes start at 0.* | ||
|
||
**How to remove an element from a list :** | ||
Type like the following : | ||
``` | ||
var:list <name> = list.remove <index> | ||
``` | ||
*Keep in mind indexes start at 0.* | ||
|
||
**How to get a specific element from a list ?** | ||
Just use it as a normal variable, this way : `{my_list[<index>]}` | ||
|
||
You can also use a variable in place of the index, but **equations won't work**. | ||
|
||
**How can I get the length of the list ?** | ||
Simply by typing `{my_list[len]}` or `{my_list[length]}`. | ||
|
||
- New setup | ||
- The new setup will install correctly the requirements, and will also ask you to set your settings. | ||
- Settings include : | ||
- Language | ||
- Color use | ||
- File opening at compiling | ||
- Comments left at compiling | ||
|
||
- Variables operators | ||
- Variables operators have been added. | ||
- Variable operators include : | ||
- `+=` | ||
- `-=` | ||
- `*=` | ||
- `/=` | ||
- `//=` | ||
- `%=` | ||
- Variable operators act as if you were using the operation before the `=` on the variable value. | ||
- Syntax example : `var:int score += 5` | ||
|
||
- Dialog boxes | ||
- Typing only `run` in the console will open a dialog box that will let you select a file to run. | ||
- The same goes on for the IDE, but this time, the dialog box opens anyway. | ||
|
||
Overall, a pretty big update. | ||
### 3.9 | ||
- IDE | ||
- Added a memory system to the IDE | ||
- Every time you close the IDE, it will save the last cursor position, and it will set the cursor to the correct position once you open this file again. | ||
- Redo | ||
- New console command | ||
- Re-iterates the last action you did | ||
- String manipulations | ||
- 2 new `var_actions` : `replace` and `split` | ||
- `replace` | ||
- Replaces elements of the string. | ||
- Syntax : `--replace:"<element_to_replace>""<replace_with>"["count"]` | ||
- The first `count` `element_to_replace` will be searched through the string and replaced by the `replace_with`. | ||
- If `count` is undefined, all the `element_to_replace` will be replaced by `replace_with`. | ||
- Example 1 *(Without `count`)* : `var:str--replace:"e""a" Test = Yeeeeeeeeeeeeeeeee` will result in `Yaaaaaaaaaaaaaaaaa` | ||
- Example 2 *(With `count`)* : `var:str--replace:"e""a""3" Test = Yeeeeeeeeeeeeeeeee` will result in `Yaaaeeeeeeeeeeeeee` | ||
- `split` | ||
- Splits the string into a string | ||
- Syntax : `--split:"<separator>"` | ||
- Example 1 : `var:str--split:" " Test = This is a test string.` will result in `['This', 'is', 'a', 'test', 'string.']` | ||
- Example 2 : `var:str--split:"ng " Test = Testing string :D` will result in `['Testi', 'stri', ':D']` | ||
- **FUNCTIONS** | ||
- Major feature of the update | ||
- Functions allow to write some code once and reuse it as much as you want. | ||
- **How to define a function *(without parameters)* ?** | ||
- Type `function <name>` | ||
- Write the code of the function under it | ||
- End by `endfunction` or `end function` | ||
- **How can I call a function *(without parameters)* ?** | ||
- Type `use_function <function_name>` | ||
- **How to define a function *(with parameters)* ?** | ||
- Add the parameter names (separated by spaces) after the `function <name>` | ||
- You can then use them inside the function as normal variables. But if you modify them, they'll become global variables. | ||
- Example : `function hello first_name last_name` | ||
- **How can I call a function *(with parameters)* ?** | ||
- Add the values of the parameters after the `use_function <function_name>`, separated by spaces. | ||
- They can be hardcoded values, variables, or equations. | ||
- Example, following the function defined above : `use_function hello TheAssassin71 {last_name}` | ||
- Bugfix : When trying to set a specific element of a list, you just couldn't. Now fixed. | ||
- **LIBS** | ||
- Biggest feature of the update | ||
- You can download and install libs through the console commands. | ||
- Type `lib install <lib>` to install one and `lib update <lib>` to update one. | ||
- If you want to uninstall any of them, type `lib delete <lib>`. | ||
- If you want to see a lib's documentation, type `lib doc <lib>`. | ||
- To use one, declare at the beginning of your program `$use: <lib>`. | ||
- Everyone can submit his lib on the [Discord](https://discord.gg/MBuKcUn), and I'll publish it every time (except some obvious exceptions (not enough optimized, dangerous, or NSFW)) ! [Tutorial here.](https://github.com/megat69/ACPL/wiki/Lib-creation) | ||
- Every library has its own documentation. | ||
- See them in the source code, and find `acpl_libs/doc_<lib>.md`, where `<lib>` is the library you're looking for. | ||
- You can look for **How to create a lib** in the [ACPL wiki](https://github.com/megat69/ACPL/wiki/Lib-creation) |
Oops, something went wrong.