Alphaprint
Write out the alphabet, again and again. Every capital prints the place where it stands.
PythonshellDebugwindow, 2020 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
PythonshellDebugwindow made Alphaprint in 2020. A program has no choice of letters at all. It is abcdefghijklmnopqrstuvwxyz over and over from a, and the only freedom is which letters become capitals. A capital prints the character whose code is its position, modulo 256. So abcdefg is a program, but abcdefh and lmnop are not.
Read the story
Positions count from 0. The specification calls the H in its example the 33rd character, which it is when the first a is number 0, and its Hello World prints Hello, World! only when counted that way. Counted from 1, every letter would come out one higher.
The machine
| Letter | Does |
|---|---|
| Lowercase, in its place | Nothing |
| Capital, in its place | Print the byte of its position modulo 256 |
| Any other letter | Not a program |
Every program ends, so a program is no more than a fixed list of bytes. Each byte must sit further on than the one before it, which makes the Hello World 1,570 letters long.
Example
The U is at position 72, the code of H.
The U is at position 72, the code of H. The next i, 105, is still ahead, so the B at position 105 prints it.
Patterns it teaches
- Encoding tricks: the text is fixed, and the output lives in where the capitals are.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Alphaprint
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: alphaprint.
Command line
shib run alphaprint -e 'abcdefghijklmnopqrstuvwxyzabcdefgH'shib manual alphaprintSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/alphaprint.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org