Sorted! is a groundbreaking programming language that won the esoteric language contest for the year 2000. Every Sorted! program consists of exactly fourteen statements, no more, no less. The language is bilingual (English/German), singable, and faithful to the Roman Catholic Church by using cardinals only once.
-
You should be able to sing a good programming language. Try singing PHP, and you'll know what I mean. Sorted! in stark contrast lends itself ideally to singing. You are encouraged to do your own recordings of Sorted! programs and post them at MP3.COM.
-
The excessive use of cardinals is sinful. Thou shalt not have the same cardinal more than once, because cardinals are Roman Catholic ministers and, as such, holy.
-
Each program should contain exactly fourteen statements.
- Each Sorted! program contains exactly 14 statements. At one point in the development cycle I thought about using sixteen statements instead, but I remembered my design criteria and did not bloat the language unnecessarily.
- Error checking in Sorted! is very simple: just count the number of statements
- Sorted! is bilingual (English and German)
- Each Sorted! program is, in fact, sorted, albeit randomly. Hence the name!
- Each Sorted! program can be sung
- Sorted! now uses OPP for enhanced programming power
- Each Sorted! is faithful to the Roman Catholic Church
Every Sorted! program consists of fourteen declarations. Every declaration has a type and a series of objects of that type. For every declaration, there are three possible alternatives:
- You can either declare no objects
- A single object
- Or a series of objects
- Cardinals - Declaration of numbers
- Going somewhere - Jumps and control flow
- Output - What to write
- Input - What to read
- Sums - Addition operations
- Conditions - Comparisons (equal, less than)
- Labels - Jump targets
- Ordered Differences - Subtraction operations
- Assignments - Variable assignments
- Products - Multiplication operations
- Implementation - Main program logic
- Ratios - Division operations
- Logical Operations - NAND only
- Coolness - Essential declaration
You must use either ordinary English cardinals or ordinary German cardinals:
This code does not use any numbers.
This code uses the number fivemilliontwentytwothousandeightynine.
This code uses the numbers Eins, Zwei, and Drei.
You cannot use a single cardinal more than once. They get fed up easily.
Declare your jumps (conditional or unconditional):
This code does never go anywhere.
This code always goes to the second label.
This code sometimes goes to the second label if the twentyfourth condition is true.
Valid output formats include:
- "a character"
- "an english cardinal"
- "an english ordinal"
- "a german cardinal"
- "a german ordinal"
- "a series of sanscrit numbers"
- "a series of basque numbers"
- "a series of Tagalog numbers"
- "a series of Classical Nahuatl numbers"
- "a series of Kwakiutl numbers"
- "a series of random numbers"
- "the german word APFELSTRUDEL."
- "an insult"
Example:
This code cannot write.
This code writes the first cell as a decimal integer.
Currently only supports character input:
This code cannot read.
This code reads the first number as a character.
Declare addition operations:
This code does not use any sums.
This code uses the sum of the first number and the second number.
Two elements can be equal, or one can be less than the other:
This code uses the condition that the first number is equal to the eight number.
Declare jump targets:
This code does not use any labels.
This code uses two labels.
Declare subtraction operations:
This code uses the ordered difference between the second number and the fifth number.
Declare variable assignments:
This code assigns the first number to the first cell.
Declare multiplication operations:
This code uses the products of the second number and the fifth number.
The main program logic as a series of implemented statements:
This code implements the first assignment, the second assignment, the first label, the first jump.
Declare division operations:
This code uses the ratios of the second number to the fifth number.
Sorted! supports only NAND:
This code uses the logical operation of not the second number and not the fifth number.
The most important statement:
This code is cool.
or simply:
Cool.
Everything after the declaration of coolness is ignored and can be used for documentation.
When referring to objects in Sorted!, you must use ordinal numbers:
- The first number
- The twentyfifth logical operation
- The twohundredandfirst condition
This is a Go implementation of the Sorted! interpreter.
go install github.com/p-nand-q/sorted@latestOr build from source:
git clone https://github.com/p-nand-q/sorted
cd sorted
go build -o sorted cmd/sorted/main.gosorted program.sortedWith OPP preprocessing:
sorted -opp program.opp.sorted
sorted -D DEBUG program.sortedThis code uses the numbers Seventytwo, Onehundredandone, Onehundredandeight, Onehundredandeleven, Thirtytwo, Eightyseven, Onehundredandfourteen, and Ten.
This code does never go anywhere.
This code writes the first cell as a character, the second cell as a character, the third cell as a character, the third cell as a character, the fourth cell as a character, the fifth cell as a character, the sixth cell as a character, the fourth cell as a character, the seventh cell as a character, the third cell as a character, the third cell as a character, and the eighth cell as a character.
This code cannot read.
This code does not use any sums.
This code does not use any conditions.
This code does not use any labels.
This code does not use any ordered differences.
This code assigns the first number to the first cell, the second number to the second cell, the third number to the third cell, the fourth number to the fourth cell, the fifth number to the fifth cell, the sixth number to the sixth cell, the seventh number to the seventh cell, and the eighth number to the eighth cell.
This code does not use any products.
This code implements the first assignment, the second assignment, the third assignment, the fourth assignment, the fifth assignment, the sixth assignment, the seventh assignment, the eighth assignment, and the first output.
This code does not use any ratios.
This code does not use any logical operations.
Cool.
Remember: The excessive use of cardinals is sinful. Use them wisely and only once.