Searchfuck
Brainfuck, typed into a search bar. Every command is one of the most common Google searches.
2022 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Searchfuck is brainfuck with its eight commands swapped for search terms. A program reads like a search history. amazon reads a byte, gmail prints one, and a loop runs from translate to traductor.
Read the story
The specification gives an interpreter in Common Lisp. It turns the words into brainfuck first and then runs that. It has one quirk. Once it sees whatsapp it always takes the next word too, so whatsapp gmail still prints, but whatsapp youtube does nothing at all.
The machine
| Search | Brainfuck |
|---|---|
youtube | > |
facebook | < |
whatsapp web | + |
google | - |
gmail | . |
amazon | , |
translate | [ |
traductor | ] |
Words are split at spaces, tabs and line feeds and must be in lower case. Every other word does nothing. The cells are bytes that wrap, the tape has no ends, and the end of the input reads as 0.
Example
The cat reads and prints until it reads a null character.
The cat reads and prints until it reads a null character. The end of the input counts as one.
The truth machine. It prints the digit, then counts the cell down by 2 at a time. From 48 that reaches 0 and stops; from 49 it never does, and the loop prints 1 forever.
Eight times eight plus one is 65, an A.
Patterns it teaches
- Camouflage: a brainfuck program hidden as a list of searches.
- Turing tarpit: it is brainfuck word for word, so it is Turing complete.
Further
See also
Searchfuck builds on Brainfuck.
Brainfuck equivalents
Pseudonatural
Write your own in Run Convert a program from Searchfuck
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: searchfuck.
Command line
shib run searchfuck -e 'amazon translate gmail amazon traductor' --input 'ab cd'