'interbasic

From Esolang
(Redirected from 'basic)
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

'interbasic was a try to make basic better. which it more looks like a intercal basic The esolang was made by User:Ractangle

Commands

Code Meaning
VAR Creates/Edits the variable.
READ Puts the values/variables to the stack. Any non values/variables will basically make the interpriter say "READ CAN ONLY SUPORT VARIABLES AND VALUES"
DATA Outputs the top value in the stack and pops it out of the stack.
CHOSE Basicly just DATA but the inputed value that exists is outputed
IF...UNLESS Condition commands. The number lines just HAS to stay the same as the previos line. Unless you wan't to end this command
REDO...<number> TIMES Repeats the section of the code number of times. If there is no "<number> TIMES". It will run forever
ASK AND READ Gets user input and puts it to the controll stack
NOTE Comment. Ignores the folowing charecters
EXECUTE Must be putten after every IF...UNLESS command. It must be in the start of the program too
GOTO <label> Executes a label one time

'interbasic = representations

Symbol Name Action (VAR) Action (IF...UNLESS)
-- Least? Does nothing Checks if the number is lower
== Normal? Creates a varable Checks if the number is "Normal"
≡≡ Most? Edits the value Checks if the number is higher

Examples

Hello World

1 EXECUTE VAR hw == Hello world
2 READ hw
3 DATA

Truth-machine

1 EXECUTE READ 0
2 READ 1 NOTE Reads the values 0 and 1
3 VAR i == ASK AND READ NOTE Gets user input
4 IF i == 0 NOTE Checks if the input is 0
4 CHOSE 0 NOTE Outputs zero and gets poped out of the stack
5 EXECUTE UNLESS i ≡≡ 0 NOTE checks if the input is higher than 0
5 REDO
5 DATA NOTE Outputs one and gets poped out of the stack
5 READ 1