TableLang

From Esolang
Jump to navigation Jump to search

TableLang is a esolang made by Mihai Popa, based on only tables. :)

Commands (in tables)

Command list
Command Meaning
Command Parameters
Set Variable to Value
Variable Value
Placeholder Something
Sets a variable to a value
Command Parameters
Print Variable
Variable
Placeholder
Prints the value of a variable
Command Parameters
Print Text
Text
Something
Prints a text string
Command Parameters
Give User Input to Variable
Variable
Something
Gives user input to a variable
Command Parameters
Comment
Text
This is just a comment, any text or notes goes here...
Marks a comment in the program
Command Parameters
Jump
Line Number
5
Jumps to a specified line number
Command Parameters
While
Variable Expression
Something Equals 5
While loop
Command Parameters
If
Variable Expression
Something Equals 5
Marks the "If" in "If, Else If, Else"
Command Parameters
Else If
Variable Expression
Something Equals 5
Marks the "Else If" in "If, Else If, Else"
Command
Else
Marks the "Else" in "If, Else If, Else"
Command
Start Loop
Starts a loop
Command
End Loop
Ends a loop
Command Parameters
For
Variable Start End Step
Something 1 100 2
For loop

Examples

Hello, world!

Line Number Command(s)
1
Command Parameters
Print Text
Text
Hello, world!

Cat

Line Number Command(s)
1
Command Parameters
Give User Input to Variable
Variable
Cat
2
Command Parameters
Print Variable
Variable
Cat

XKCD Random Number

Line Number Command(s)
1
Command Parameters
Print Text
Text
4
2
Command Parameters
Comment
Text
Chosen by fair dice roll.
3
Command Parameters
Comment
Text
Guaranteed to be random.

Truth Machine

Note that this is the longest program in this language...

Line Number Command(s)
1
Command Parameters
Give User Input to Variable
Variable
Truth
2
Command Parameters
If
Variable Expression
Truth Equals 0
3
Command Parameters
Print Text
Text
0
4
Command Parameters
Comment
Text
This is the first part, when the user types "0" and it prints "0".
5
Command Parameters
While
Variable Expression
Truth Equals 1
6
Command
Start Loop
7
Command Parameters
Print Text
Text
1
8
Command
End Loop
9
Command Parameters
Comment
Text
This is the second part, when the user types "1" and loops printing "1".