Glassman
Brainfuck, sung one line of Mister Glassman at a time.
cinnamony, 2023 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
cinnamony made Glassman in 2023, after the song Mister Glassman. Each of brainfuck's eight commands is a line of the song, and three more lines start the script, print a piece of text and end it. A program is one line of the song per command, so it reads as a set of lyrics.
The machine
A tape of byte cells and a pointer, as in brainfuck.
| Line | Does |
|---|---|
Let's paint a picture | Start the script |
So nervously he looks around | Read a character into the cell |
In front of fans rappin' fast | Print the cell as a character |
A few years later when now it's prom season | Move right |
You're in class | Move left |
And he's always in his head thinking too far ahead | Add 1 |
Don't be shy kid, make your own fate | Subtract 1 |
Even if you think you're bullet proof | brainfuck's [ |
I am glass and so are you | brainfuck's ] |
They're calling her text | Print the text |
Woppity wop | End the script, as it ends the song |
Indentation does not count. Reading past the end of the input gives 0, the null character that ends the cat.
Example
The truth machine.
The truth machine. Eight times six takes 48 off the character read, so a 0 leaves the cell at 0, the loop that prints 1 forever is skipped and the last line prints 0.
Patterns it teaches
- Camouflage: a brainfuck program that reads as song lyrics.
- Turing tarpit: eight commands on a tape of cells.
Further
See also
Glassman builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from Glassman
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: glassman.
Command line
shib run glassman -e 'Let'\''s paint a picture
They'\''re calling her Hello, world!
Woppity wop'shib manual glassmanSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/glassman.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org