'interbasic

From Esolang
Jump to navigation Jump to search

'interbasic was a try to make basic better, but instead the creator (User:Ractangle) got something possibly INTERCAL-like

Commands

Code Meaning
VAR Creates/Edits the variable.
READ Puts the numbers/variables to the data stack. If it's not a number/variable, a syntax error will be risen.
DATA Outputs the nth value (determined by the second argument, top is the default) in the data stack and pop it.
IF...UNLESS Condition commands. The number lines just needs to stay the same as the previous line. Unless you want to end this command.
USER Gets user input and puts it to the data stack.
NOTE Comment. Ignores the following character in the line.
EXECUTE Must be putten after every IF...UNLESS command and be in the start of the program. And needs to be putten between line if you want to make a one-liner (that excludes the NOTE command)
:<label> Goto statement.
.<label> Create 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 READ 0 1
2 VAR i -- USER
3 IF i == 0 EXECUTE DATA 0
4 UNLESS i ≡≡ 0
4 .r
4 DATA EXECUTE READ 1
4 :r

Infinite loop

1 .0 EXECUTE :0