Sus

From Esolang
Jump to navigation Jump to search

Sus is an esoteric programming language that is Turing complete; it is an alternative brainfuck. This was something user User:iGottic made in free time originally on the Roblox platform, but eventually decided to port it to the love2d framework in another set of free time for non-robloxians.

Similar to brainfuck, it is based on an array and pointer. The pointer moves across an array and may increment/decrement values, and output that value as an ASCII character.

Syntax

Sus is written with 7 symbols listed below:

Symbol Meaning
> Move pointer one spot forward in the array
< Move pointer one spot backward in the array
+ Increment the current pointer value by 1
- Decrement the current pointer value by 1
$ If current pointer value is 0, skip past the next !
! Go back to the previous $
| Convert the current pointer value to ASCII and add to output string

Any other characters are ignored when the program is compiled.

At the end of the code read, the interpreter prints the final output.

The values are 97 by default, which is a in ASCII.

Hello world

"Hello world!" can be printed with the following input:

-------------------------|>++++|>+++++++++++||>++++++++++++++|>-----------------------------------------------------------------|
>++++++++++++++++++++++|<<|>>>+++++++++++++++++|<<<<|>>>>>+++|>----------------------------------------------------------------|

Here is it broken down:

  • -------------------------| Go back to the ASCII value for "H," and add to output
  • >++++| Go forward a cell, go to the ASCII value for "e," and add to output
  • >+++++++++++| Go forward a cell, go to the ASCII value for "l," and add to output
  • | The current pointer already equals "l," so just re-add it to the output
  • >++++++++++++++| Go forward a cell, go to the ASCII value for "o," and add to output
  • >-----------------------------------------------------------------| Go forward a cell, go to the ASCII value for space, and add to output
  • >++++++++++++++++++++++| Go forward a cell, go to the ASCII value for "w," and add to output
  • <<| A couple cells ago, we already defined the letter "o," so go back to it and print it
  • >>>+++++++++++++++++| Go forward three cells, go to the ASCII value for "r," and add to output
  • <<<<| We already defined a value for "l," so go back to that cell and print that value
  • >>>>>+++| Go forward five cells, go to the ASCII value for "d," and add to output
  • >----------------------------------------------------------------| Go forward a cell, go to the ASCII value for "!," and add to output

SUS

Here is some code that prints "sus"

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣴⣆⣠⣤⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣻⣿++⠹⣧⣤⡀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠿⢿⣿⣷⣾⣯⠉⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿+⣿⡍⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⠁⠀⠘⣿⣆⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⡟⠃⡄⠀⠘⢿⣆⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾+⣁⣋⣈ +++⣧⡀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠++++++++++⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⡿⠉⠙⠛⠛⠛⠛⠻⢿⣿⣷⣤⡀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠈⢻+|⣿⡄⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⠀⣠+⣾⣿⣿⣿⠿⠿⠿⢿⣿⣿⣿⣄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠁⠀⠀⢰⣿⣿⣯⠁⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⣷⡄⠀
⠀⠀⣀+|⣴⣶⣶⣿⡟⠀⠀⠀⢸⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⠀
⠀⢰⣿⡟⠋⠉⣹⣿⡇⠀⠀⠀⠘⣿⣿⣿⣿⣷⣦⣤⣤⣤⣶⣶⣶⣶⣿⣿⣿⠀
⠀⢸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
⠀⣸⣿⡇⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠉⠻⠿⣿⣿⣿⣿⡿⠿⠿⠛⢻⣿⡇⠀⠀
⠀⣿⣿⠁⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣧⠀⠀
⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
⠀⣿⣿⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀
⠀⢿⣿⡆⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀
⠀⠸⣿⣧⡀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠃⠀⠀
⠀⠀⠛--⣿⣿⣇⠀⠀⠀⠀⠀⣰⣿⣿⣷⣶⣶⣶⣶⠶⠀⢠⣿⣿⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⣽⣿⡏⠁⠀⠀⢸⣿⡇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⣿⣿⡇⠀⢹⣿⡆⠀⠀⠀⣸⣿⠇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢿|⣦⣄⣀⣠⣴⣿⣿⠁⠀⠈⠻⣿⣿⣿⣿⡿⠏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⠿⠿⠿⠿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀


Interpreter