'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 emit "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.
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> <amout of times> Goto statement.
.<label> Just makes a label.

'interbasic = representations

Symbol Name Action (VAR) Action (IF...UNLESS)
-- Least? Turns the variable into an integer 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 VAR t -- TRUE NOTE THIS IS NESESARY BECUASE GOTO HAS THE NUMBER OF REAPEAT TIMES ARGUMENT
2 READ 0
3 READ 1 NOTE Reads the values 0 and 1
4 VAR i -- ASK AND READ NOTE Gets user input
5 IF i == 0 NOTE Checks if the input is 0
5 CHOSE 0 NOTE Outputs zero and gets poped out of the stack
6 EXECUTE UNLESS i ≡≡ 0 NOTE checks if the input is higher than 0
6 .r
6 DATA NOTE Outputs one and gets poped out of the stack
6 READ 1
6 :GOTO r t NOTE reapeats the whole process again and again

Infinite loop

1 EXECUTE VAR t -- TRUE
2 .l
3 VAR i == inf
4 READ i
5 DATA
6 :GOTO l t