Skip to content

Instantly share code, notes, and snippets.

@gbrls
Created December 15, 2023 21:54
Show Gist options
  • Save gbrls/c5870a4d92861d8b44320d49e4fff6f4 to your computer and use it in GitHub Desktop.
Save gbrls/c5870a4d92861d8b44320d49e4fff6f4 to your computer and use it in GitHub Desktop.
esolang test
This language process each line as an unit.
╔══╗ ╔══╗ This line will push 2 and 2 to the stack.
╚══╝ ╚══╝
╔══╗ ╔══╗ This line will push again.
║«0--0» ║ This will take 4 elements out of the stack, multiply them and put them back.
╚══╝ ╚══╝
╔══╗ ╔══╗ This will push 2 and 2...
╚══╝ ╚══╝
«00» This will take two elements out of the stack, and multiply them.
«()» ╔══╗ This line will take two elements out of the stack, multiply them, push the result and then push 2 to the stack
╔══╗ ╔══╗
╔══╗ ╔══╗ Nothing new here...
╚══╝ ╚══╝
╚══╝ ╚══╝
╚══╝
«-0|0-» Nothing new here...
┌**┐....This line will take two elements out of the stack, SUM them and push the result.
╔════════╗
║.V.┌**┐.║ Nothing new here...
║.-►╔═══╗║ This line will copy the top of the stack and push it, and then it'll push 3
║ ▼►.....║ This line will pop two times, subtract the first from the second, put it back, and then copy it
║........║
║╔══════╗║ Nothing new here...
║║..╔═╗ ║║ Nothing new here...
║║..╚═╝ ║║
║║┌(*)┐►►║ Here we'll pop 3 elements, multiply them, push the result and then copy it 2 times.
╔═══╗
┌**┐
so far we have 'hello'
╔══╗►►►
►«-(*)-»►
now let's build 'world'
╔══╗►► ►►►«-(())-»┌**┐
╔═══════════════════════╗
║ ┌**┐ . ║
║ ► . ║
║ ╔════════╗ ║
║ ▼► ║
║ ╔═══╗┌**┐ . ║
║ ► . ║
║ ╔══════╗▼ ║
║ ► . ║
║ ╔════════╗▼ ║
║ ╔══╗►►►║ ║
║ ►«-(*)-» ║ . ║
║ ╔═╗ ║ ║
║ ┌**┐ ║ . ║
║ . ║
╚═══════════════════════╝
printing starts here.
this star ╔════════════╗
is the pr- ☼ ║
int opcode ╚════════════╝
it takes the first element as the number of chars to print. then it pops that
number of elements from the stack and prints them as a string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment