Goatoo

From Esolang
Jump to navigation Jump to search
Goatoo
Paradigm(s) imperative
Designed by User:DynCoder
Appeared in 2021
Memory system Cell-based/Stack-based
Computational class Unknown
Reference implementation GitHub
File extension(s) .goto

Goatoo is an esoteric programming language created by User:DynCoder in May 2021. It is especially made for people who hate the goto command. The official interpreter is written in python and published on github under a GPLv3 license.

Language Overview

The language uses 2 different memory systems: a stack, containing ascii codes (up to 255), and a cell system, containing booleans. Goatoo has 23 commands:

Command Description
:X Go to line X
=X Check if the ascii value of letter X is equal to the number at the top of the stack, and save the result to the cell at the pointer
~X Check if the number X is equal to the number at the top of the stack and save the result to the cell at the pointer
! Invert the state of the cell at the pointer (True <-> False)
> Move the pointer right
< Move the pointer left
? Skip the next line if the cell at the pointer contains False
] Output the symbol of which the ascii value is equal to the number on top of the stack
[ Get a symbol as input and save it's ascii value to the top of the stack
} Output the number on top of the stack
{ Get a number as input and save it to the top of the stack
|X Save the ascii value of symbol X to the top of the stack
(X Save number X to the top of the stack
+ Pop the top two numbers on the stack, add them up, and save the result to the top of the stack
- Pop the top two numbers on the stack, subtract the lower number from the top number, and save the result to the top of the stack
* Pop the top two numbers on the stack, multiply them, and save the result to the top of the stack
/ Pop the top two numbers on the stack, divide the top number by the lower number, and save the result to the top of the stack
% Pop the top two numbers on the stack, divide the top number by the lower number, and save the remainder to the top of the stack
\ Swap the top two items on the stack
& Copy the top value on the stack
^ Pop the top item on the stack
; End the program
# Comment (skips the line)

The program always has to end with ;, otherwise it will cause an exception, this however also terminates the program.