# Sorted!

This page describes **Sorted!**, the winner of the
esoteric language contest
for the year 2000 !

## Design Criteria

I keep hearing these voices telling me that my cd tray wants to marry me, and this was part of my incentive for designing this language. Other than that, I firmly believe in the following design criteria:

- 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 sinfull. Thou shalt not have the same cardinal more than once, because cardinals are roman-catholic ministers and, as such, holy. (I leave it to the reader to determine the meaning of "to have a cardinal"). For the more mathematically inclined, here is a list of the living cardinals arranged by date of birth. You won't find this kind of information at the Math Forum Internet Mathematics Library.
- Each program should contain exactly fourteen statements.

Since I found that most modern programming languages (Java, C# and the VAX assembler (which is here mainly because it can be sung)) do not fullfill all of these to equal extent, I decided that it was time to write a programming language from scratch. Here are its main

## Features

- Each Sorted! program contains exactly the same number of statements, namely fourteen(14). No more, no less. 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.
- Because of this, error checking in Sorted! is very simple: just count the number of statements; if there are more or less than 14 statements, the program definitely won't work; if it has 14 statements, it will have a very high chance of working (compared to non-14-liners).
- Sorted! is bilingual. It can understand both english and german code. To my knowledge, Sorted! is the only programming language that can do this, in the world.
- 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, by using cardinals only once, and by not including any satanistic references like Java does.

## Examples

Currently, the following sample programs are available for your entertainment:

### HELLO.S - an an english-language version of Hello, World.

```
This code uses the numbers zero, one, seventy two, one hundred and one, one hundred eight, two hundred,
one hundred eleven, fourtyfour, thirtytwo, eightyseven, twohundred one, onehundred fourteen, two hundred two,
onehundred, fourtysix, and twohundredtwentytwo.
This code always goes to the first label, and sometimes goes to the second label if the first condition is true.
This code writes the cell indexed by the first number as a character.
This code cannot read.
This code uses the sum of the first number and the second number.
This code uses the condition that the sixteenth number is equal to the cell indexed by the first number.
This code uses two labels.
This code does not use any ordered differences.
This code assigns the fifth number to the sixth number, the first number to the sixteenth number, the first sum to
the first number, the seventh number to the eleventh number, and the fifth number to the thirteenth number.
This code does not use any products.
This code implements the first assignment, the second assignment, the third assignment, the fourth assignment, the
third assignment, the fifth assignment, the third assignment, the first label, the second jump, the first output,
the third assignment, the first jump, and the second label.
This code does not use any ratios.
This code does not use any logical operations.
Cool.
```

### HALLO.S - the equivalent german-language version of Hallo, Welt.

```
Dieses Programm benutzt die Zahlen
Null,
Eins,
Zweiundsiebzig,
Siebenundneunzig,
Einhundertacht,
Zweihundert,
Einhundertelf,
Vierundvierzig,
Zweiunddreissig,
Siebenundachtzig,
Einhunderteins,
Zweihundertzwei,
Einhundertsechzehn,
Sechsundvierzig, und
Zweihundertzweiundzwanzig.
Dieses Programm
springt immer an das erste Sprungziel, und
springt manchmal an das zweite Sprungziel wenn die erste Bedingung wahr ist.
Dieses Programm
schreibt diejenige Zelle die indiziert wird durch die erste Zahl als ein Zeichen.
Dieses Programm
kann nicht lesen.
Dieses Programm
benutzt die Summe aus der ersten Zahl und der zweiten Zahl.
Dieses Programm
benutzt die Bedingung dass die sechzehnte Zahl ist gleich diejenige Zelle die indiziert wird durch die erste Zahl.
Dieses Programm
benutzt zwei Sprungziele.
Dieses Programm
benutzt keine geordneten Differenzen.
Dieses Programm
weisst zu die fuenfte Zahl an die sechsten Zahl,
die erste Zahl an die fuenfzehnte Zahl,
die erste Summe an die erste Zahl,
die siebente Zahl an die zweihundertelfte Zahl, und
die fuenfte Zahl an die zwoelfte Zahl.
Dieses Programm benutzt keine Produkte.
Dieses Programm implementiert
die erste Zuweisung,
die zweite Zuweisung,
die dritte Zuweisung,
die vierte Zuweisung,
die dritte Zuweisung,
die fuenfte Zuweisung,
die dritte Zuweisung,
den ersten Sprungziel,
der zweite Sprungbefehl,
die erste Ausgabe,
die dritte Zuweisung,
den ersten Sprungbefehl,
und das zweite Sprungziel.
Dieses Programm
benutzt keine Verhaeltnisse.
Dieses Programm
ist unlogisch.
Cool.
```

### ITOA.S converts an integer to a string and prints it.

```
This code uses the numbers fourtyone milliontwohundredeightyonethousand ninehundredtwentyseven, ten, eleven, fourtyeight,
eighty, seventynine, one, and zero.
This code sometimes goes to the second label if the first condition is true, sometimes goes to the first label if the
second condition is true, and
sometimes goes to the second label if the third condition is true.
This code writes the cell indexed by the fifth number as a character.
This code cannot read.
This code uses the sums of the third number and the fourth number, and of the fifth number and the seventh number.
This code uses the condition that the first number is equal to the eight number,
the condition that the eight number is less than the first number, and the condition that the fifth number is less than the sixth number.
This code uses two labels.
This code uses the ordered differences between the fifth number and the seventh number, and between the first number and the third number.
This code assigns
the first ratio to the third number,
the first ordered difference to the fifth number,
the fifth number to the sixth number,
the first ratio to the first number,
the first sum to the cell indexed by the fifth number,
the first product to the third number,
the eight number to the cell indexed by the fifth number,
the second ordered difference to the third number, and
the second sum to the fifth number.
This code uses the product of the second number and the third number.
This code implements the seventh assignment, the third assignment,
the second assignment, the first label, the first assignment, the sixth assignment,
the eight assignment, the fourth assignment, the second assignment, the fifth assignment,
the first jump, the second jump, the second label, the first output, the ninth assignment, and the third jump.
This code uses the ratio of the first number to the second number.
This code does not use any logical operations.
This code is cool.
```

### FIBO.S calculates a fibonacci number and prints it.

```
This code uses the numbers twenty, seventyone, three, two, and one.
This code sometimes goes to the second label if the first condition is true,
sometimes goes to the fourth label if the second condition is true,
always goes to the third label,
always goes to the fifth label, and
always goes to the first label.
This code writes the eleventh number as a english cardinal.
This code cannot read.
This code uses the sums of the tenth number and the eleventh number,
and of the second number and the fifth number.
This code uses the condition
that the second number is equal to the first number,
and the condition that the second number is less than the third number.
This code uses five labels.
This code does not use any ordered differences.
This code assigns the fourth number to the tenth number,
the fifth number to the eleventh number,
the fifth number to the second number,
the second sum to the second number,
the eleventh number to the fourth number,
the eleventh number to the tenth number,
and the first sum to the eleventh number.
This code does not use any products.
This code implements
the third assignment,
the first label,
the first jump,
the second jump,
the third jump,
the fourth label,
the second assignment,
the sixth assignment,
the fourth jump,
the third label,
the fifth assignment,
the seventh assignment,
the first assignment,
the fifth label,
the first output,
the fourth assignment,
the fifth jump, and
the second label.
This code does not use any ratios.
This code does not use any logical operations.
Cool.
```

## Download

You can download the distribution for Win32 here. You can download the distribution for Linux here.

NEW: You can download the distribution for the AMIGA here. (Tested with WinUAE only, comments welcome).

When you do so, you get a program that can interpret Sorted! code and optionally create a C-Source from it. You may send the generated C-Source output to your printer and pin it (the output) on the wall; free of charge, too. (GPL doesn't cover this bit).