Whopper

From Esolang
Jump to navigation Jump to search

Whopper is a stack-based language created by User:hyperdawg. It was created in python in under 100 lines of code.

Commands

PSH <number> pushes <number> to the stack
POP pops the top value off the stack and prints as a number
PPC pops the top value off the stack and prints as an ASCII character
INP gets user input and pushes it to the stack
HLT halts the program
ADD pops two top values off stack, then pushes the sum
SUB same as ADD, but minus
MUL same as ADD, but times
DIV same as ADD, but divided
MOD same as ADD, but modulo
NLN prints a newline character

comments are defined by:
: <comment>
there MUST be a space between the : and the comment

Programs

hi

: hi

: Print the letter 'h'.
PSH 10
PSH 10
MUL
PSH 4
ADD
PPC

: Print the letter 'i'.
PSH 10
PSH 10
MUL
PSH 5
ADD
PPC
NLN

cat

: cat

INP
POP

Interpreter

  • Common Lisp implementation of the Whopper programming language.