Tables

From Esolang
Jump to navigation Jump to search
Number That Means Nothing Description
00 Tables is an esoteric programming language by User:SoundOfScripting where all instructions, programs, and modes are made of tables. Programming in Tables will be a nightmare due to the overwhelming amount of tables that must be looked through.
01 Tables in whole is less of a single programming language, and more of a table-filled table of programming languages.
02 The commands and instructions used in a Tables program will change depending on the current mode
03 Programs in tables will be made of many tables
04
Some Tables May Even Have More Tables Inside Of Them
05
Mode Number Mode
0000
Name of Property of Mode Property of Mode
Description
  • The default mode used in every program
  • A simple language that uses a global table to store data.
  • The global table contains the program, data, input, and output.
  • All table indices are strings and all values at those indexes are also strings.
  • Program code is executed from index 0, then after every line the program will execute from the same index, but the number at the end of the index will be incremented (0 goes to 1, 1 goes to 2, MyFunc123 goes to MyFunc124)
Command Syntax
Line Number Table of Instruction Name Containing Table of Instruction Arguments
<LINE NUMBER>
Instruction Name Instruction Arguments
<NAME>
Argument Value
Arg1 <ARG1>
Arg2 <ARG2>
etc... <ETC...>
List of Instructions
Instruction Name Table of Parameters (bold = required) Description
Set
Table Index Value
Sets index Index of table Table to Value. Table defaults to the global table if not specified.
Get
Table Index
Returns Table of index Index if Table is a table, if Table is a string returns Global of Table of index Index
Jump
Line Number
The next instruction will be read from index Line Number. (Note: If a line that does not end with a number or digit is jumped too, the code on the line will execute fine, but Tables will terminate afterwards if it hasn't jumped somewhere else.)
Use
Mode Number
The rest of the code will be executed using the mode with number Mode Number.
Other notes
Useless Numerical Value Note
0 Index "Global" of the global table references the global table.
1 Index "Input" of the global table is a table filled with inputs (any indices)
2 Index "Output" of the global table is a table used as output of the program (any indices)
3 Accessing a table at an index that has no defined value returns the string "NULL"
4 The global table is predefined with the program and any data included in the source code.
5 In most cases, the label of a column in a table does not matter, but for readable code they should be named appropriately (in fact, the label is not required)
6 A index beginning with a * is to be interpreted as a command when accessed, no matter the table it is in. When reading from the index, the * is ommited.
7 Attempting to execute a "NULL" (or any other invalid command) will terminate the program.
Examples
Example Name Source Code
Cat program
Line Number/Global Table Index Instruction/Value
0
Instruction Name Parameters
Set
Parameter Name Parameter Value
Index Output
*Value
Name of Instruction Table of Parameters
Get
Name of Parameter Value
Table Global
Index Input
Cheating Quine Program
Line number/Index Instruction/Value
0
Instruction Name Parameter Table
Set
Parameter Name Value
Index Output
*Value
Instruction Name Parameter Table
Get
Parameter Name Value
Table Global
Index Global
0001
Property of Mode Value of Property of Mode
Description
  • Mode 0001 has only one instruction.
  • That instruction will append the contents of a JSON formatted file to the Global table.
Command Syntax
Line Number File to read
0 filename.extension
Other Notes
Number that means nothing Note
0 If an invalid file or path is given, the program returns to Mode 0000 on the next instruction.
1 Files can be read that are in a sub directory (dir/file.extension) or an outside directory (../dir/file.extension)
2 Files can append new commands to the program to be executed.
0002
Property of Mode Value of Property of Mode
Description
  • Mode 0002 is a simple inverse of Mode 0001 that allows a Tables program to output a table to a file.
  • Like Mode 0001, 0002 also only has one instruction.
Command Syntax
File & Directory Names Table
dir/filename.extension <Index of Global table where table is located, or a literal table>
Other Notes None