EsoBASIC

From Esolang
Jump to navigation Jump to search

EsoBASIC is an esolang made by User:Yes in 2022

Commands

Caption text
Command Description
PRINT Print something to the console
PRINTVAR Prints a variable
INPUT Get input and store it into a variable
LET Create a variable
LET -= Decrements a variable
LET += Increments a variable
GOTO Go to a line
IF Check if a variable is 0. If it is, skip next line
CLS Clear console
END End program/Terminate execution

Examples

Hello, World

CLS
PRINT Hello, World
END

Cat program

CLS
INPUT a
PRINTVAR a
IF a
GOTO 2
END

Truth Machine

CLS
LET i
INPUT i
IF i
GOTO 7
PRINT 0
END
PRINT 1
GOTO 7

99 Bottles of Beer
(b must be 99 for this to work)
(this is slightly abriged)

CLS
LET b
PRINTVAR b
PRINT  Bottles of Beer on the Wall
PRINTVAR b
PRINT  Bottles of Beer
PRINT Take one down, pass it around,
LET -= b
PRINT  Bottles of Beer on the Wall
IF b
GOTO 4
END

Square number

LET x
LET x_1
LET x_2
LET x_3
LET x_4
INPUT x
LET += x_1
LET += x_2
LET += x_3
LET -= x
IF x
GOTO 7
LET += x
LET -= x_1
IF x_1
GOTO 13
LET -= x_2
IF x_2
GOTO 22
PRINTVAR x
END
LET += x_1
LET += x_4
LET -= x_3
IF x_3
GOTO 22
LET += x_3
LET -= x_4
IF x_4
GOTO 27
GOTO 13

Deadfish interpreter

You should use ASCII character's value instead of ASCII character itself

LET cmd
LET x
LET x_1
LET x_2
LET x_3
LET x_4
INPUT cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
IF cmd
GOTO 111
GOTO 137
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
IF cmd
GOTO 119
GOTO 135
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
IF cmd
GOTO 128
GOTO 139
LET -= cmd
LET -= cmd
LET -= cmd
LET -= cmd
IF cmd
END
GOTO 141
LET += x
GOTO 7
LET -= x
GOTO 7
PRINTVAR x
GOTO 7
LET += x_1
LET += x_2
LET += x_3
LET -= x
IF x
GOTO 141
LET += x
LET -= x_1
IF x_1
GOTO 147
LET -= x_2
IF x_2
GOTO 156
PRINTVAR x
GOTO 7
LET += x_1
LET += x_4
LET -= x_3
IF x_3
GOTO 156
LET += x_3
LET -= x_4
IF x_4
GOTO 161
GOTO 147

Computational class

Turing complete, because complier from 3-register Minsky machine to EsoBASIC has been created.

External Resources