oOo CODE
Brainfuck hidden in the capital letters of any text you like, the way trolls write online.
2006 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 4 known programs · Hello World on Try It Online: identical · Test method
Run it
The idea
oOo CODE hides brainfuck in ordinary text, in the style of Bacon's cipher. Only the case of each letter matters. Three letters make one command, so any story with enough letters can carry any program, and punctuation, spaces and digits are free decoration.
Read the story
The best example is a program that names itself. PROgRam reVERsES giVeN iNPut sEqUENcE is the brainfuck ,[>,]<[.<]+, and it reverses its input.
The machine
Take the Latin letters, three at a time. Upper case is 1, lower case 0. One or two letters left at the end do nothing.
| Bits | Example | Brainfuck |
|---|---|---|
| 000 | ooo | > |
| 001 | ooO | < |
| 010 | oOo | [ |
| 011 | oOO | ] |
| 100 | Ooo | - |
| 101 | OoO | + |
| 110 | OOo | . |
| 111 | OOO | , |
The brainfuck runs with byte cells that wrap at 256, a tape that grows both ways, and 0 at the end of the input.
Example
The second is the tribute to xkcd 221, where a random number, chosen by a fair dice roll, is 4.
The second is the tribute to xkcd 221, where a random number, chosen by a fair dice roll, is 4.
Patterns it teaches
- Camouflage: the program is invisible until you look at the case of each letter.
- Encoding tricks: three bits per command, carried by a property of the text that readers ignore.
Further
See also
oOo CODE builds on Brainfuck.
Brainfuck equivalents
Cell-based
Write your own in Run Convert a program from oOo CODE
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: ooocode.
Command line
shib run ooocode -e 'OOOOOoOOOOOoOOOOOo' --input 'abcd'shib manual ooocodeSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/ooocode.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org