We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

ABPLWNL but with stack

From Esolang
Jump to navigation Jump to search
ABPLWNL but with stack
Designed by Mario0Fan
Appeared in 2022
Dimensions one-dimensional
Computational class Unknown
Reference implementation Interpreter
Influenced by ABPLWNL
idont need loops but I need a stack lol - Mario0Fan 2022

A Bad Programming Language With No Loops but with stack is a stack-based esolang made by User:Mario0Fan

This language is based off ABPLWNL.

If you don't know what a stack is, go check it out here

Commands

If you want to know how this language works, go here.

List of commands
Command Description
1 Increments A by 1.
2 Decrements A by 1 if its not 0
3 Swaps A and B.
4 If B is not 0, B is decremented by 1 and A is incremented by 1.
5 Adds the value of B to A and sets B to 0.
6 Prints the value of B
7 Prints an unicode character corresponding to the unicode value of B
8 Sets A to 0
9 Sets B to an integer the user has typed in.
a Skips the next command if A is equal to 0
t Pushes A onto the stack
u Sets A to the top value on the stack, then pops the top value.
e Exits the program

I didn't know what shortcut to give to these commands, so they're numbers and random letters.

Errors

The python interpreter has 2 errors:

ERROR 1: Unknown command.

and

ERROR 2: Stack Underflow

Examples

there's currently only 1 example ;-;

definitely-not-a-truth-machine:)

93t3ua6e

If a 0 is inputted, the program ends.

If a 1 is inputted, the program prints one 1 and ends.

How it works

It might just seem like gibberish, but its actually pretty simple

Command How it works
9 The user is asked for input, then it stores the input into B
3 It moves the input into A, so then it can be pushed into the stack.
t It pushes A (which stores the input) onto the stack, so it can be cloned to B.
3 Moves A (the input) into B.
u Pops the top value of the stack and puts it in A. Now both A and B have the input
a Skips the next command if A (the input that was just cloned) is 0
6 Prints the value of B (the input that was just cloned). Of course, this is skipped if A is 0
e Ends this program

im bad at explaining

Implementations

Interpreter in Python (replit)

Interpreter for Linux in Python