SStack

From Esolang
Jump to navigation Jump to search

SStack (Seven Stacks) is an esolang by User:ChuckEsoteric08 inspired by Kipple and was designed as more powerful version of Sreg.

Commands

SStack uses seven stacks:a, b, c, d, e, f and g, each containing unsigned integers. If you try to accsess empty stack then it would return 0. Decrementing zero is a nop

>x/y< - pop element from stack x and push it to stack y
+x/y+ - pop element from stack x, increment it and push it to stack y
-x/y- - like +x/y+ but decrement
;x; - push ASCII value of next byte of user input to stack x
:x: - output top of the stack x as ASCII character
"x/y" - push x to stack y
[x\y/code] - execute code while top of the stack x and top of the stack y are equal

Computational class

There is (untested) brainfuck interpreter created in SStack:


"1/a""1/b""33/c""0/d"
[a\b/
 ;d;
 [d\c/
  >c/b<"0/c"
 ]
]
~b~
[a\b/
 >d/e<
 [d\c/
  >c/b<"1/c"
 ]
]
~b~~c~"256/c""0/c"
[a\b/
 "0/g"
 "43/g"
 [g\e/
  +c/c+
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "45/g"
 [g\e/
  -c/c-
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "62/g"
 [g\e/
  >f/c<
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "60/g"
 [g\e/
  >c/f<
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "44/g"
 [g\e/
  ;c;
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "46/g"
 [g\e/
  :c:
  "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 "91/g"
 [g\e/
  "0/g"
  [c\g/
   [a\b/
    "0/g"
    >e/d<
    "91/g"
    [g\d/
     [a\b/
      ~g~
      "0/d"
       [d\g
        "2/b"
       ]
       ~d~
     ]~b~
     ~g~+g/g+
    ]
    [a\b/
     ~g~
     "0/d"
     [d\g/
      "2/b"
     ]
     ~d~
   ]~b~
    "0/g"
    >e/d<
    "93/g"
    [g\d/
     [a\b/
      ~g~
      "0/d"
       [d\g/
        "2/b"
       ]
       ~d~
     ]~b~
     ~g~"0/d"[d\g/"0/b"~g~]~d~-g/g-
    ]~b~
   ]
  ]
 "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~>e/d<
 "93/g"
 [g\e/
  "0/g"
  [c\g/
   [a\b/
    "0/g"
    >d/e<
    "91/g"
    [g\d/
    "0/b"
    [a\b/
     ~g~
     "0/d"
      [d\g/
       "2/b"
      ]
      ~d~
    ]~b~
    ~g~+g/g+
   ]
   [a\b/
    ~g~
    "0/d"
    [d\g/
     "2/b"
    ]
    ~d~
  ]~b~
   "0/g"
   >e/d<
   "93/g"
   [g\d/
    [a\b/
     ~g~
     "0/d"
      [d\g/
       "2/b"
      ]
      ~d~
    ]~b~
    ~g~"0/d"[d\g/"0/b"~g~]~d~-g/g-
   ]~b~
  ]
 "1/g"
 ]
 [a\b/
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
 >e/d<
 "256/g"
 [c\g/
  "0/c"
 ]
  ~g~
  "0/d"
  [d\g/
   "2/b"
  ]
 ~d~
 ]~b~
]

New lines were added for readability, but they are optional. Input is seperated from program by ! like in dbfi