https://esolangs.org/wiki/StupidStackLanguage StupidStackLanguage From Esolang Jump to navigation Jump to search [300px-Ssl] SSL Logo StupidStackLanguage (or SSL) is an esoteric programming language created by Lebster in which all operations take place on a Stack SSL Uses the characters A-Z to perform actions. SSL is also case-insensitive. [ ] Contents * 1 Operations * 2 Examples + 2.1 Hello World + 2.2 Cat + 2.3 Truth-machine + 2.4 Find the Factorial of a Number + 2.5 Calculator o 2.5.1 Usage + 2.6 Print the Fibonacci Sequence + 2.7 Print a box of any character + 2.8 Print any string * 3 Implementations + 3.1 Website + 3.2 Python o 3.2.1 Usage o 3.2.2 Online + 3.3 Get string from program * 4 Notes Operations Note: Items on the stack can only be numbers. Character Operation a Pushes 0 to the top of the stack b Pops the 1st item from the stack c Subtracts the 2nd item on the stack from the 1st item and pushes the result to the stack d Decrements the 1st item of the stack by 1 e Pushes the 1st item mod the 2nd item onto the stack f Prints the 1st item on the stack as an ASCII character g Adds the first 2 stack items together and pushes the result to the stack h Gets input from the user as a number and pushes to the stack i Increments the 1st item of the stack by 1 j Gets input from the user as a character and pushes that characters ASCII code onto the stack k Skips the next command if the 1st item on the stack is 0 l Swaps the 1st and 2nd items on the stack m Multiplies the first two stack items together and pushes the result onto the stack n If the 1st item on the stack is equal to the 2nd item, push a 1 to the stack, else push a 0 o Pops the (first item on the stack)th item on the stack p Divides the 1st item on the stack by the 2nd item and pushes the result onto the stack q Duplicates the 1st item on the stack r Pushes the total length of the stack onto the stack s Swaps the 1st and (first item on the stack)th items on the stack t If the 1st item on the stack is 0, jumps to the corresponding 'u' in the program, otherwise does nothing u If the 1st item on the stack is not 0, jumps back to the corresponding 't' in the program, otherwise does nothing v Increments the top item on the stack by 5 w Decrements the top item on the stack by 5 x Prints the 1st item on the stack y Deletes the entire stack z Exits the script Examples Hello World avdqvdmavvqmiqiiifvdlfbffiiiflblblfbqviiifbfiiifwdfwwiif Cat jf Truth-machine htxux Find the Factorial of a Number hqdtmldubx h # Set X q # Duplicate x (z) d # Decrement z (y) t # Begin loop m # Multiply y by x l # Swap result and y d # Decrement y u # End loop b # Pop remaining 0 x # Print (x!) Calculator hhhtdtdtblpxzubmxzublcxzubgxz Usage Takes 3 inputs, X, Y and Z Z Program output 0 X + Y 1 X - Y 2 X * Y 3 X / Y Print the Fibonacci Sequence # Note: Works best on tio.run as when run via command line it runs so fast that you can't really see any of the numbers. axiqvvdflxlwwltgavvfbxu Print a box of any character jfffavvflflqvvvviifblflflfff Print any string I have created a script which can convert any string into an SSL program that will print that string. You can find it on tio.run HERE Example program created with this script: # Prints "StupidStackLanguage" avvvvvvvvvvvvvvvviiifvvvvvviiififwfwddfwfwwwddfvvvvvviiifwwwwifiifviiifwwwwwwdfvvvvifvviiifwddfvvvdfwwwwfvifddf Implementations Website You can use the website to run SSL code online, however due to being programmed in javascript, it's considerably slower than tio.run, which itself is much slower than saving the python interpreter. Python import sys, re f = open(sys.argv[1], "r"); prg = f.read(); f.close(); stack = [] prg = (re.compile('#(?=.*).*',re.IGNORECASE).sub("",prg)) prg = (re.compile('[^abcdefghijklmnopqrstuvwxyz]*', re.IGNORECASE).sub("", prg)) prgPos = 0 shouldSkip = False while prgPos= 0: if prg[prgPos] == "t" and closed == 0: break elif prg[prgPos] == "u": closed += 1 elif prg[prgPos] == "t": closed -= 1 prgPos -= 1 elif char == "v": stack[0]+=5 elif char == "w": stack[0]-=5 elif char == "x": print(stack[0],end="") elif char == "y": stack = [] elif char == "z": sys.exit(0) else: print("Invalid character:",char,"at",prgPos); sys.exit(0) prgPos+=1 Usage > python SSL.py [SSL SCRIPT] Online You can use the interpreter online HERE Get string from program THIS JS script can take an SSL program that prints something and can tell you what it would print, however it only works with scripts generated by or following the same rules as HERE Notes Comments can be written as such: # Comment Retrieved from "https://esolangs.org/w/index.php?title= StupidStackLanguage&oldid=80674" Categories: * Implemented * Languages * Stack-based * 2020 * Turing complete * Low-level Navigation menu Personal tools * Create account * Log in Namespaces * Page * Discussion [ ] Variants Views * Read * View source * View history [ ] More Search [ ][Search][Go] Navigation * Main page * Community portal * Language list * Browse by category * Recent changes * Random page * Help Tools * What links here * Related changes * Special pages * Printable version * Permanent link * Page information * This page was last edited on 10 February 2021, at 14:12. * Content is available under CC0 public domain dedication. * About Esolang * Disclaimers * CC0 public domain dedication * Powered by MediaWiki * Hosting donated by Bytemark