Skip to content

Releases: NikkyHika/Language-Programming-Language

Language 1.0.4 translator + editor (lpl -> cpp)

03 Jun 18:41
31f01f9
Compare
Choose a tag to compare

The LPL is just a simplified C++.
structure file
|- text file.fileGetContents(text file_path) = reads text from a file.
|- void file.filePutContents(text file_path, text file_contents) = writes text from a file.
|- void file.fileAddContents(text file_path, text append_contents) = appends text to a file.
structure convert
|- text convert.number_to_text(number num) = converts a number to text (123 -> "123").
|- number convert.text_to_number(text text) = converts a text to number ("123" -> 123).
|- symbol convert.number_to_symbol(number num) = converts a number to symbol by number code (97 -> 'a').
|- number convert.symbol_to_number(symbol sym) = converts a symbol to number by symbol code ('a' -> 97).
|- text convert.symbol_to_text(symbol sym) = converts a symbol to text ('a' -> "a").
structure os
|- text os.getPath() = get current directory.
|- list<text> os.listDir() = get list of directiores and files.
|- void os.deleteFile(text filename) = deletes file.
|- void os.deleteFolder(text foldername) = deletes directory.
|- void os.createFolder(text foldername) = creates directory.
|- void os.changeDir(text foldername) = creates directory.
|- void os.cmdCommand(text command) = runs a command line command (IMPORTANT! The "cd" command does not work, use os.changeDir).
structure ConsoleColor
|- number BLACK = 0
|- number BLUE = 1
|- number GREEN = 2
|- number CYAN = 3
|- number RED = 4
|- number MAGENTA = 5
|- number BROWN = 6
|- number LIGHTGRAY = 7
|- number DARKGRAY = 8
|- number LIGHTBLUE = 9
|- number LIGHTGREEN = 10
|- number LIGHTCYAN = 11
|- number LIGHTRED = 12
|- number LIGHTMAGENTA = 13
|- number YELLOW = 14
|- number WHITE = 15
text ask() = accepts text entered by the user.
list<text> explode(symbol separator, text text) = splits the text into list.
void setConsoleColor(number textColor, number backgroundColor = ConsoleColor.BLACK) = changes the color of the console.
number getCharCode() = waits for a key to be pressed and returns its code, just like _getch() does.
void help() = prints a list of methods and keywords to the console.
number getElementIndex(list<typename> l, typename e) = returns the index of an element in a list.
list<typename>::iterator listBegin(list<typename>& l) = returns a list iterator, like list.begin().
list<typename>::iterator listEnd(list<typename>& l) = returns a list iterator, like list.end().

-- 21 methods --

display ? = prints text to the console.
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.
text = a variable type that stores text, the text must be in double quotes ("Hello, world!").
symbol = a variable type that contains a single character is protected by apostrophes ('a').
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.find(), list.begin() and list.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)).
begin = opens a block of code.
end = closes a block of code.

-- 7 keywords --

Language 1.0.3 translator (lpl -> cpp)

30 May 14:23
e1485eb
Compare
Choose a tag to compare

The LPL is just a simplified C++.
structure file
|- text file.fileGetContents(text file_path) = reads text from a file.
|- void file.filePutContents(text file_path, text file_contents) = writes text from a file.
|- void file.fileAddContents(text file_path, text append_contents) = appends text to a file.
structure convert
|- text convert.number_to_text(number num) = converts a number to text (123 -> "123").
|- number convert.text_to_number(text text) = converts a text to number ("123" -> 123).
|- symbol convert.number_to_symbol(number num) = converts a number to symbol by number code (97 -> 'a').
|- number convert.symbol_to_number(symbol sym) = converts a symbol to number by symbol code ('a' -> 97).
|- text convert.symbol_to_text(symbol sym) = converts a symbol to text ('a' -> "a").
structure os
|- text os.getPath() = get current directory.
|- list<text> os.listDir() = get list of directiores and files.
|- void os.deleteFile(text filename) = deletes file.
|- void os.deleteFolder(text foldername) = deletes directory.
|- void os.createFolder(text foldername) = creates directory.
|- void os.changeDir(text foldername) = creates directory.
|- void os.cmdCommand(text command) = runs a command line command (IMPORTANT! The "cd" command does not work, use os.changeDir).
structure ConsoleColor
|- number BLACK = 0
|- number BLUE = 1
|- number GREEN = 2
|- number CYAN = 3
|- number RED = 4
|- number MAGENTA = 5
|- number BROWN = 6
|- number LIGHTGRAY = 7
|- number DARKGRAY = 8
|- number LIGHTBLUE = 9
|- number LIGHTGREEN = 10
|- number LIGHTCYAN = 11
|- number LIGHTRED = 12
|- number LIGHTMAGENTA = 13
|- number YELLOW = 14
|- number WHITE = 15
text ask() = accepts text entered by the user.
list<text> explode(symbol separator, text text) = splits the text into list.
void setConsoleColor(number textColor, number backgroundColor = ConsoleColor.BLACK) = changes the color of the console.
number getcharcode() = waits for a key to be pressed and returns its code, just like _getch() does.
void help() = prints a list of methods and keywords to the console.

-- 21 methods --

display ? = prints text to the console.
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.
text = a variable type that stores text, the text must be in double quotes ("Hello, world!").
symbol = a variable type that contains a single character is protected by apostrophes ('a').
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.find(), we recommend using a loop to find the element, like here, we will fix it).

template<typename LT>
number GetInx(list<LT> l, LT e) begin
    number i = 0;
    while (l[i] != e) begin
        i++;
        if (i >= l.size())
            return -1;
    end
    return i;
end

begin = opens a block of code.
end = closes a block of code.

-- 7 keywords --

Language 1.0.2

24 Mar 18:04
3879368
Compare
Choose a tag to compare

YOU MUST INSTALL MINGW COMPILER AND PUT MINGW FOLDER INTO THE FOLDER WITH THE EXECUTIVE FILE!
Added work with command line and file system, updated lists and explode function.

explode(symbol separator, text text); - splits a string into a list of texts, returns list<text>.
getPath(); - gets the directory path it is currently in, returns text.
listDir(); - gets a list of files and folders from the current directory, returns list<text>.
deleteFile(text filename); - deletes a file.
deleteFolder(text foldername); - deletes a directory (only if it's empty).
createFolder(text foldername); - creates a folder.
changeDir(text foldername); - move to another directory.
cmdCommand(text command); - execute command line command.

Language 1.0.1

23 Mar 14:54
d13dee8
Compare
Choose a tag to compare

Language 1.0.1
YOU MUST INSTALL MINGW COMPILER AND PUT MINGW FOLDER INTO THE FOLDER WITH THE EXECUTIVE FILE!
This is a builder that turns LPL into CPP and then with g++ into EXE.