Gaot++

From Esolang
Jump to: navigation, search

Description

Gaot++ is a stack-based programming language with 2 types of commands: baas and bleets.

Gaot++ have a instruction pointer going to the right, but the direction can be reversed.

baa commands

A baa command is matched by the following regex: ba{2,}.

A baa command push it count of a minus 1.

bleet commands

A bleet command is matched by the following regex: ble{2,}t.

A bleet command execute a action based on it count of e:

Count of e Action on stack Description
2 a, b -> a + b Push the sum of the two values on the top of the stack
3 a, b -> b - a Push the difference of the two values on the top of the stack
4 -> Skip the next command
5 -> Terminate the program
6 -> Reverse the IP direction
7 a -> Skip the next instruction if the value on the top of the stack is not zero
8 a -> Skip the next instruction if the value on the top of the stack is zero
9 a -> Pop a value and print it as a number
10 a -> Pop a value and print it as a character
11 -> a Read a number from stdin
12 -> a Read a character from stdin
13 a -> a, a Duplicate the top of the stack
14 a, b -> b, a Swap the top of the stack
15 a... -> ...a Reverse the stack
16 a...b -> ...b, a Rotate the stack

Example programs

Hello World version 1

Prints the string Hello, World!.

baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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leeeeeeeeeet
baaaa
bleet
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeeeeet
bleeeeeeeeeeeeet
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet
bleet
baa
bleeet
bleeeeeeeeeeeeet
bleeeeeeeeeet
baaaaaaaaaaaaaa
bleet
bleeeeeeeeeeeeet
baaaaaaaaa
bleet
bleeeeeeeeeeeeet
baaaa
bleet
bleeeeeeeeeeeeet
bleeeeeeeeeet
baaaa
bleet
bleeeeeeeeeet
bleeeeeeeeeet
bleeeeeeeeeet
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bleeeeeeeeeet

Truth machine

bleeeeeeeeeeet
bleeeet bleeeeeet
bleeeeeeeeeeeeet
bleeeeeeeeeeeeet
bleeeeeeeeeeeeet
bleeeeeeeeeeeeet
bleeeeeeeeet
bleeeeeeeet

Cat program

bleeeeeeeeeeeet
bleeeet bleeeeeet
bleeeeeeeeeet bleeeet blet
bleeeeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeet bleeeeeet

Reverse cat program

bleeeet bleeeeeet
bleeeeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeet bleeeeeet
bleet
bleet
bleeeet bleeeeeet
bleeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeeeeeeet bleeeet blet
bleeeeeeeet bleeeeeet

Implementations