# LOLSUS

Jump to navigation
Jump to search

### LOLSUS is an esolang created by User:Martsadas

### Valid Instructions :

**Instructions that starts with INNOCENT**

Instructions name | Arguments | What it does |

INNOCENT RED | RED | Clears the stack |

INNOCENT ORANGE | ORANGE V N | Inserts the value V in the stack between V and V+1 |

INNOCENT YELLOW | YELLOW A B L | Goes to L if A and B are equal |

INNOCENT GREEN | GREEN V N | Sets cell V to value N |

INNOCENT LIME | LIME A B [] | Runs line [] if A and B are equal |

INNOCENT BLUE | BLUE V | Outputs variable/constant V as a number |

INNOCENT CYAN | CYAN V | Outputs variable/constant V as a character |

INNOCENT PURPLE | PURPLE | Reverses the stack |

INNOCENT PINK | PINK V | Pushes the variable/constant V to the stack |

INNOCENT BLACK | BLACK | Ends the program |

INNOCENT WHITE | WHITE | Swaps the top 2 items of the stack |

**Instructions that start with SUS**

Instructions name | Arguments | What it does |

SUS RED | RED A B | Returns A + B |

SUS ORANGE | ORANGE A B | Returns A - B |

SUS YELLOW | YELLOW A B | Returns A / B |

SUS GREEN | GREEN A B | Returns A * B |

SUS LIME | LIME A B | Returns 1 if A > B. Returns 0 if A <= B |

SUS BLUE | BLUE | Gets input as a number and returns it |

SUS CYAN | CYAN | Gets input as a character and returns it. The input is converted to the character's ASCII value |

SUS PURPLE | PURPLE V | Pops the V'th value from the stack and returns it |

SUS PINK | PINK | Gets input as a character and returns it |

SUS BLACK | BLACK V | Returns value of cell V |

SUS WHITE | WHITE A B | Returns a random number between A and B |

**Instructions that don't start with SUS or INNOCENT**

Instructions name | Arguments | What it does |

SET | SET V N [] | Sets the variable V to the number/variable N. If N is F then the line of code [] is run and V is set to whatever [] returns |

LOCATION | LOCATION N | A location the code can go to |

GO | GO L | Goes to location called L |

VOTE | VOTE | Gets input as a boolean and returns it. The input is converted to a number | False -> 0 | True -> 1 |

## Example Programs:

### Hello World

INNOCENT CYAN 72 INNOCENT CYAN 101 INNOCENT CYAN 108 INNOCENT CYAN 108 INNOCENT CYAN 111 INNOCENT CYAN 44 INNOCENT CYAN 32 INNOCENT CYAN 87 INNOCENT CYAN 111 INNOCENT CYAN 114 INNOCENT CYAN 108 INNOCENT CYAN 100 INNOCENT CYAN 33 INNOCENT CYAN 10 INNOCENT BLACK ! End the program

### Truth-machine

SET val F SUS BLUE ! Get input and store it into val INNOCENT YELLOW val 1 one ! Goto one if val == 1 INNOCENT BLACK ! End the program if val != 1 LOCATION one INNOCENT BLUE 1 ! Print 1 GO one

### 99 bottles of beer on the wall

SET bottles 99 GO v LOCATION v INNOCENT BLUE bottles INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 111 INNOCENT CYAN 116 INNOCENT CYAN 116 INNOCENT CYAN 108 INNOCENT CYAN 101 INNOCENT CYAN 115 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 102 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 101 INNOCENT CYAN 101 INNOCENT CYAN 114 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 110 INNOCENT CYAN 32 INNOCENT CYAN 116 INNOCENT CYAN 104 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 119 INNOCENT CYAN 97 INNOCENT CYAN 108 INNOCENT CYAN 108 INNOCENT CYAN 10 INNOCENT BLUE bottles INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 111 INNOCENT CYAN 116 INNOCENT CYAN 116 INNOCENT CYAN 108 INNOCENT CYAN 101 INNOCENT CYAN 115 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 102 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 101 INNOCENT CYAN 101 INNOCENT CYAN 114 INNOCENT CYAN 10 INNOCENT CYAN 116 INNOCENT CYAN 97 INNOCENT CYAN 107 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 110 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 100 INNOCENT CYAN 111 INNOCENT CYAN 119 INNOCENT CYAN 110 INNOCENT CYAN 10 INNOCENT CYAN 112 INNOCENT CYAN 97 INNOCENT CYAN 115 INNOCENT CYAN 115 INNOCENT CYAN 32 INNOCENT CYAN 105 INNOCENT CYAN 116 INNOCENT CYAN 32 INNOCENT CYAN 97 INNOCENT CYAN 114 INNOCENT CYAN 111 INNOCENT CYAN 117 INNOCENT CYAN 110 INNOCENT CYAN 100 INNOCENT CYAN 10 INNOCENT CYAN 10 SET bottles F SUS ORANGE bottles 1 ! Subtract 1 from bottles INNOCENT YELLOW bottles 1 o GO v LOCATION o INNOCENT CYAN 49 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 111 INNOCENT CYAN 116 INNOCENT CYAN 116 INNOCENT CYAN 108 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 102 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 101 INNOCENT CYAN 101 INNOCENT CYAN 114 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 110 INNOCENT CYAN 32 INNOCENT CYAN 116 INNOCENT CYAN 104 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 119 INNOCENT CYAN 97 INNOCENT CYAN 108 INNOCENT CYAN 108 INNOCENT CYAN 10 INNOCENT CYAN 49 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 111 INNOCENT CYAN 116 INNOCENT CYAN 116 INNOCENT CYAN 108 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 102 INNOCENT CYAN 32 INNOCENT CYAN 98 INNOCENT CYAN 101 INNOCENT CYAN 101 INNOCENT CYAN 114 INNOCENT CYAN 10 INNOCENT CYAN 116 INNOCENT CYAN 97 INNOCENT CYAN 107 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 111 INNOCENT CYAN 110 INNOCENT CYAN 101 INNOCENT CYAN 32 INNOCENT CYAN 100 INNOCENT CYAN 111 INNOCENT CYAN 119 INNOCENT CYAN 110 INNOCENT CYAN 10 INNOCENT CYAN 112 INNOCENT CYAN 97 INNOCENT CYAN 115 INNOCENT CYAN 115 INNOCENT CYAN 32 INNOCENT CYAN 105 INNOCENT CYAN 116 INNOCENT CYAN 32 INNOCENT CYAN 97 INNOCENT CYAN 114 INNOCENT CYAN 111 INNOCENT CYAN 117 INNOCENT CYAN 110 INNOCENT CYAN 100 INNOCENT CYAN 10 INNOCENT BLACK ! End the program

### Deadfish

SET x 0 GO inst LOCATION inst INNOCENT LIME x -1 SET x 0 ! Make sure that x is not -1 INNOCENT LIME x 256 SET x 0 ! Make sure that x is not 256 SET c F SUS CYAN INNOCENT LIME c -1 INNOCENT BLACK ! End the program if x == -1 INNOCENT YELLOW c 105 i INNOCENT YELLOW c 100 d INNOCENT YELLOW c 115 s INNOCENT YELLOW c 111 o LOCATION i SET x F SUS RED x 1 ! Increment x GO inst LOCATION d SET x F SUS ORANGE x 1 ! Decrement x GO inst LOCATION s SET x F SUS GREEN x x ! Square x GO inst LOCATION o INNOCENT BLUE x ! Output x GO inst