100% developed

Programming in LOLGraphics 3.4/LOLGraphics Cheat Sheet

From Wikibooks, open books for an open world
Jump to navigation Jump to search
*Note that this page only explains what the commands do in version 3.4 and some of them have slightly changed functionality or were only added in later versions. For more info, please see the itch.io page.
Command What it does
PLZ TYPE TEXT <string> prints the string to the console, doesn’t go to the next line.
PLZ PRINT TEXT <string> prints the string to the console, goes to the next line after that.
PLZ TYPE ONE BYTE/TWO BYTE/FOUR BYTE/EIGHT BYTE <index/variable> prints the value in the given index or variable in the given segment. Doesn’t go to the next line.
PLZ PRINT ONE BYTE/TWO BYTE/FOUR BYTE/EIGHT BYTE <index/variable> prints the value in the given index or variable in the given segment. Goes to the next line after that.
PLZ ADD A SPACE Adds a space to the terminal.
I CAN HAS A CHEEZBURGER? draws a cheeseburger on the graphics area. You can draw multiple cheeseburgers on the screen, and choose their location using the command PLZ DELIVR MAH CHEEZBURGERS 2
PLZ DELIVR MAH CHEEZBURGERS 2 <x> <y> sets the position of cheeseburgers drawn after this command is run. Does not affect existing cheeseburgers already on the screen.
PLZ WAIT 4 DA USR 2 REACT activates the input button, and waits for the user to press it. Only then will the program continue to the next line. Useful for debugging.
PLZ CLEAR TEH SCREEN clears the graphics area.
PLZ CLEAR TEH CONSOLE clears the console.
I HAS A ONE BYTE/TWO BYTE/FOUR BYTE/EIGHT BYTE DAT IZ CALLED <name> defines a variable of the given size with the given name. What it actually does is giving a label to the first available address in the specified segment. If you define multiple variables with the same name, the code will work but will always access the first one.
PLZ SET ONE/TWO/FOUR/EIGHT BYTE <address/variable> <number/variable> sets the specified address or variable to the specified variable. All variables must be in the same segment. Also you can specify arithmetic operations, but there is a limitation. You can’t use more than one type of operation per line. PLZ SET EIGHT BYTE B C+5+A is valid but ...C-5+A is not.
PLZ GIMME A RANDOM ONE/TWO/FOUR/EIGHT BYTE <address/variable> sets the specified address or variable to a random number.
PLZ ASK TEH USR 2 GIMME A ONE/TWO/FOUR/EIGHT BYTE <address/variable> halts the program until the user types a number and presses the input button. Then, the number is stored in the specified variable, and removed from the input field.
IM IN UR SUBPROGRAM DAT IZ KALLED <name> write this line at the beginning of every subprogram. By design, if the code is written correctly, the interpreter will never try to run this line, however if you put it in a place where it will be reached, you will see a message saying that the interpreter doesn’t know what to do.
PLZ RUN SUBPROGRAM <name> runs the specified subprogram.
IM OUTTA UR SUBPROGRAM ends the current subprogram, goes back to run the line after the one that called the subprogram.
PLZ ASK CEILIN KAT 2 CHEK IZ <condition> checks if the specified condition is true. If it is, saves true in the flag. If it’s false, saves false. Example: PLZ ASK CEILIN KAT 2 CHEK IZ [I]<[MAX]. Allowed operations: < == >.
IF CEILIN KAT IZ NODDING PLZ RUN <subprogram> runs the specified subprogram if the value of the flag is true.
ELSE PLZ RUN <program> runs the specified subprogram if the value of the flag is false. A valid command, independent of the if command.
PLZ ASK CEILIN CAT 2 NOD sets the value of the flag to true.
PLZ ASK CEILIN CAT 2 STOP NODING sets the value of the flag to false
FOREVER RUN <subprogram> runs the specified subprogram in an infinite loop
WHILE CEILIN CAT IZ NODDIN PLZ RUN <subprogram> runs the subprogram while the value of the flag is true. Don’t forget to add a condition at the end of the subprogram in order to update the flag otherwise you will get an infinite loop.
PLZ SET DELAY <number> changes the amount of time that passes in between every two commands.
PLZ READ ONE/TWO/FOUR/EIGHT BYTE <address/variable> doesn’t wait for the user and reads the number in the input field. Saves the number of the specified variable or address. Also clears it.
SWITCH <variable/address> copies the value of the variable or address to an 8 bit variable in the memory. Unlike most programming languages, this is a command and not a structure.
CASE <number/a list of numbers separated by commas without spaces> <subprogram> checks if the value of the variable used in switch is equal to the specified number or one of the specified numbers. If yes, runs the specified subprogram.
LABELCASE <number/numbers separated by commas without spaces> <label> like case, only jumps to a label instead of running a subprogram.
PLZ CHANGE TEXT COLOR <color> changes the color of the text in the console. Can get the name of the color (black, blue, cyan, dark gray, gray, green, light gray, magenta, orange, pink, red, white, or yellow): PLZ CHANGE TEXT COLOR CYAN Can also accept an rgb value: ... 100 100 100. In addition can also accept the word random that will change the text color to a random number.
PLZ LOAD IMAGE <image name in the code> <file name> loads an image. Example: PLZ LOAD IMAGE EXAMPLE EXAMPLE.PNG
PLZ DRAW IMAGE <image name> draws the specified image on the screen on the location chosen for drawing cheeseburgers.
PLZ DRAW LINE <x1> <y1> <x2> <y2> draws a line from point (x1,y1) to (x2,y2). x1, y1, x2, and y2 can be numbers or two byte variables.
PLZ CHANGE PAINT BRUSH <color> changes the color of lines drawn in the future. Does not affect existing lines. The color can be specified either by its name (list of supported colors in PLZ CHANGE TEXT COLOR <color>), by its rgb value, or a random color by typing the word RANDOM.
PLZ GIMME A RANDOM ONE/TWO/FOUR/EIGHT BYTE IN RANGE <address/variable> <min> <max> generates a random number in the given range and saves it in the specified address or variable. min and max can be just numbers, not variables.
PLZ DRAW RECT <x1> <y1> <width> <height> draws the outline of a rectangle with the top left corner in the specified coordinates (x1,y1) and with the specified width and height. You can enter as parameters numbers or two byte variables.
PLZ FILL RECT <x1> <y1> <width> <height> draws and fills a rectangle with the top left corner in the specified coordinates (x1,y1) and with the specified width and height. You can enter as parameters numbers or two byte variables. If you want to draw a rectangle with an outline in another color, first write PLZ FILL RECT and only then PLZ DRAW RECT
PLZ DRAW ELLIPSE <x1> <y1> <width> <height> draws the outline of an ellipse with the top left corner in the specified coordinates (x1,y1) and with the specified width and height. You can enter as parameters numbers or two byte variables.
PLZ FILL ELLIPSE <x1> <y1> <width> <height> draws and fills a ellipse with the top left corner in the specified coordinates (x1,y1) and with the specified width and height. You can enter as parameters numbers or two byte variables.
PLZ FILL TEH SCREEN colors the entire screen with the color of the paint brush. Can be changed using the command PLZ CHANGE PAINT BRUSH
PLZ DRAW POLY <points> draws a polygon through the specified points. Must be at least 3 points (6 numbers) and an even number of numbers (x,y coordinates). PLZ DRAW POLY 10 10 150 200 100 20 is a valid command while PLZ DRAW POLY 10 10 150 200 100 20 5 and PLZ DRAW POLY 10 10 150 200 are not.
DIS IZ MY LABEL! IT IZ KALLED <name> a label
PLZ GOTO LABEL <label> jumps to the specified label.
PLZ READ CHAR <address/variable> reads the character that was entered and saves it's unicode value in the specified two bytes variable, or the specified address in the two bytes segment. Only supports two bytes values. If more than one character is provided, it will only put attention to the first character.
PLZ DRAW BACKGROUND draws a very large image that can’t fit the screen. Used in the scrolling demo that is included in the editor.