Skip to content

Commit 31f01f9

Browse files
authored
Update README.md
1 parent 1e05a42 commit 31f01f9

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

README.md

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,62 @@ Simple programming language
44
[Windows](https://github.com/NikkyHika/Programming-Language-Language/releases/tag/v1.0.3)
55

66
# help();
7-
The LPL is just a simplified C++.
8-
structure file
9-
|- `text file.fileGetContents(text file_path)` = reads text from a file.
10-
|- `void file.filePutContents(text file_path, text file_contents)` = writes text from a file.
11-
|- `void file.fileAddContents(text file_path, text append_contents)` = appends text to a file.
12-
structure convert
13-
|- `text convert.number_to_text(number num)` = converts a number to text (123 -> "123").
14-
|- `number convert.text_to_number(text text)` = converts a text to number ("123" -> 123).
15-
|- `symbol convert.number_to_symbol(number num)` = converts a number to symbol by number code (97 -> 'a').
16-
|- `number convert.symbol_to_number(symbol sym)` = converts a symbol to number by symbol code ('a' -> 97).
17-
|- `text convert.symbol_to_text(symbol sym)` = converts a symbol to text ('a' -> "a").
18-
structure os
19-
|- `text os.getPath()` = get current directory.
20-
|- `list<text> os.listDir()` = get list of directiores and files.
21-
|- `void os.deleteFile(text filename)` = deletes file.
22-
|- `void os.deleteFolder(text foldername)` = deletes directory.
23-
|- `void os.createFolder(text foldername)` = creates directory.
24-
|- `void os.changeDir(text foldername)` = creates directory.
25-
|- `void os.cmdCommand(text command)` = runs a command line command (IMPORTANT! The "cd" command does not work, use os.changeDir).
26-
structure ConsoleColor
27-
|- `number BLACK = 0`
28-
|- `number BLUE = 1`
29-
|- `number GREEN = 2`
30-
|- `number CYAN = 3`
31-
|- `number RED = 4`
32-
|- `number MAGENTA = 5`
33-
|- `number BROWN = 6`
34-
|- `number LIGHTGRAY = 7`
35-
|- `number DARKGRAY = 8`
36-
|- `number LIGHTBLUE = 9`
37-
|- `number LIGHTGREEN = 10`
38-
|- `number LIGHTCYAN = 11`
39-
|- `number LIGHTRED = 12`
40-
|- `number LIGHTMAGENTA = 13`
41-
|- `number YELLOW = 14`
42-
|- `number WHITE = 15`
43-
`text ask()` = accepts text entered by the user.
44-
`list<text> explode(symbol separator, text text)` = splits the text into list<text>.
45-
`void setConsoleColor(number textColor, number backgroundColor` = ConsoleColor.BLACK)` = changes the color of the console.
46-
`number getCharCode()` = waits for a key to be pressed and returns its code, just like _getch() does.
47-
`void help()` = prints a list of methods and keywords to the console.
48-
`number getElementIndex(list<typename> l, typename e)` = returns the index of an element in a list.
49-
`list<typename>::iterator listBegin(list<typename>& l)` = returns a list iterator, like list<typename>.begin().
50-
`list<typename>::iterator listEnd(list<typename>& l)` = returns a list iterator, like list<typename>.end().
51-
52-
-- 21 methods --
53-
54-
`display ?` = prints text to the console.
55-
`number` = a variable type that stores in 32-bit a number from -2147483644 to 2147483648 if you add unsigned in front of it, it will also be from 0 to 4294967295.
56-
`text` = a variable type that stores text, the text must be in double quotes ("Hello, world!").
57-
`symbol` = a variable type that contains a single character is protected by apostrophes ('a').
58-
`list<typename>` = a list of objects (variables), you can learn more about them as vector in C++: https://learn.microsoft.com/en-us/cpp/standard-library/vector-class?view=msvc-170 (IMPORTANT: do not use list<typename>.find(), list<typename>.begin() and list<typename>.end(), we recommend using a `number getElementIndex(list<typename> l, typename e)`, `list<typename>::iterator listBegin(list<typename>& l)` and `list<typename>::iterator listEnd(list<typename>& l)`).
59-
`begin` = opens a block of code.
60-
`end` = closes a block of code.
61-
62-
-- 7 keywords --
7+
The LPL is just a simplified C++.
8+
structure file
9+
|- `text file.fileGetContents(text file_path)` = reads text from a file.
10+
|- `void file.filePutContents(text file_path, text file_contents)` = writes text from a file.
11+
|- `void file.fileAddContents(text file_path, text append_contents)` = appends text to a file.
12+
structure convert
13+
|- `text convert.number_to_text(number num)` = converts a number to text (123 -> "123").
14+
|- `number convert.text_to_number(text text)` = converts a text to number ("123" -> 123).
15+
|- `symbol convert.number_to_symbol(number num)` = converts a number to symbol by number code (97 -> 'a').
16+
|- `number convert.symbol_to_number(symbol sym)` = converts a symbol to number by symbol code ('a' -> 97).
17+
|- `text convert.symbol_to_text(symbol sym)` = converts a symbol to text ('a' -> "a").
18+
structure os
19+
|- `text os.getPath()` = get current directory.
20+
|- `list<text> os.listDir()` = get list of directiores and files.
21+
|- `void os.deleteFile(text filename)` = deletes file.
22+
|- `void os.deleteFolder(text foldername)` = deletes directory.
23+
|- `void os.createFolder(text foldername)` = creates directory.
24+
|- `void os.changeDir(text foldername)` = creates directory.
25+
|- `void os.cmdCommand(text command)` = runs a command line command (IMPORTANT! The "cd" command does not work, use os.changeDir).
26+
structure ConsoleColor
27+
|- `number BLACK = 0`
28+
|- `number BLUE = 1`
29+
|- `number GREEN = 2`
30+
|- `number CYAN = 3`
31+
|- `number RED = 4`
32+
|- `number MAGENTA = 5`
33+
|- `number BROWN = 6`
34+
|- `number LIGHTGRAY = 7`
35+
|- `number DARKGRAY = 8`
36+
|- `number LIGHTBLUE = 9`
37+
|- `number LIGHTGREEN = 10`
38+
|- `number LIGHTCYAN = 11`
39+
|- `number LIGHTRED = 12`
40+
|- `number LIGHTMAGENTA = 13`
41+
|- `number YELLOW = 14`
42+
|- `number WHITE = 15`
43+
`text ask()` = accepts text entered by the user.
44+
`list<text> explode(symbol separator, text text)` = splits the text into list<text>.
45+
`void setConsoleColor(number textColor, number backgroundColor = ConsoleColor.BLACK)` = changes the color of the console.
46+
`number getCharCode()` = waits for a key to be pressed and returns its code, just like _getch() does.
47+
`void help()` = prints a list of methods and keywords to the console.
48+
`number getElementIndex(list<typename> l, typename e)` = returns the index of an element in a list.
49+
`list<typename>::iterator listBegin(list<typename>& l)` = returns a list iterator, like list<typename>.begin().
50+
`list<typename>::iterator listEnd(list<typename>& l)` = returns a list iterator, like list<typename>.end().
51+
52+
-- 21 methods --
53+
54+
`display ?` = prints text to the console.
55+
`number` = a variable type that stores in 32-bit a number from -2147483644 to 2147483648 if you add unsigned in front of it, it will also be from 0 to 4294967295.
56+
`text` = a variable type that stores text, the text must be in double quotes ("Hello, world!").
57+
`symbol` = a variable type that contains a single character is protected by apostrophes ('a').
58+
`list<typename>` = a list of objects (variables), you can learn more about them as vector in C++: https://learn.microsoft.com/en-us/cpp/standard-library/vector-class? view=msvc-170 (IMPORTANT: do not use list<typename>.find(), list<typename>.begin() and list<typename>.end(), we recommend using a `number getElementIndex(list<typename> l, typename e)`, `list<typename>::iterator listBegin(list<typename>& l)` and `list<typename>::iterator listEnd(list<typename>& l)`).
59+
`begin` = opens a block of code.
60+
`end` = closes a block of code.
61+
62+
-- 7 keywords --
6363
```cpp
6464
number main() begin
6565
display "Hello, world!"

0 commit comments

Comments
 (0)