11CORTLANG

From Esolang
Jump to navigation Jump to search

11CORTLANG (the 11th language by Cortex) is a stack-based language made by Cortex using only the characters 0, 1, and newline. Also, the null program is a cat program, because of course it is.

Syntax and commands

Commands are separated with newlines. If a line starts with 0, push the contents of the rest of the line on top of the stack. Otherwise, if the line starts with 1, do something depending on the table below (the syntax is 1[commandname]).

Command name What it does
0 Nop.
1 Pop the value on the top of the stack.
00 Print the value on the top of the stack as an ASCII character. If the value is a decimal, round up
01 Add the top two stack values.
10 Subtract the top two stack values. (top - second from top)
11 Multiply
000 Divide (top / second from top)
001 Get a number from user input
010, followed by anything Take the part of the command that isn't the 010 at the start. Go forward that many lines.
Anything else Take the command name as a binary number (remove any zeroes at the start). Run the below command that many times.

Examples

Hello, World!

0100001
01100100
01101100
01110010
01101111
01010111
0100000
0101100
01101111
01101100
01101100
01100101
01001000
1101
100

Compressed:

33 7
100 8
108 8
114 8
111 8
87 8
32 7
44 7
111 8
108 8
108 8
101 8
72 8
13 4
4 3

External resources

interpreted in python by User:Nmcassa changed 010 command and didn't implement the anything command to get a working model, I won't change the description by the OC incase anyone wants to make a true interpreter but from what I understand that hello world example wouldn't work because it doesn't move down the stack and just prints the top stack however many times.