Broccosprout
A brainfuck substitution. Each of its 8 tokens replaces one brainfuck command; everything else works as in brainfuck.
Spelling
| Token | Command | What it does |
|---|---|---|
Plant␠some␠broccoli␠seeds.␠$ | > | move the pointer one cell right |
Plant␠some␠brussels␠sprouts␠seeds.␠$ | < | move the pointer one cell left |
Water␠the␠broccoli␠and␠brussels␠sprouts.␠$ | + | add 1 to the cell (255 + 1 wraps to 0) |
Vernalize␠the␠broccoli␠and␠brussels␠sprouts.␠$ | - | take 1 from the cell (0 - 1 wraps to 255) |
Pollinate␠the␠broccoli␠and␠brussels␠sprouts.␠Take␠the␠male␠flower,␠rub␠it␠lightly␠with␠a␠paintbrush,␠and␠move␠the␠pollen␠to␠the␠female␠flower.␠$ | . | print the cell as a byte |
Wait␠for␠the␠broccoli␠and␠brussels␠sprouts␠to␠form␠the␠seed␠pods␠$ | , | read one byte into the cell (0 at the end of input) |
Separate␠the␠seed␠from␠the␠chaff.␠$ | [ | if the cell is 0, jump past the matching ] |
Plant␠the␠broccosprout␠seeds␠and␠jump␠with␠excitement!␠$ | ] | if the cell is not 0, jump back to the matching [ |
In the table, ␠ marks a space inside a token.
Tokens are matched longest first; any other character is ignored.
Examples
Hello World
Expected output
Hello World!
Output
Print the letter A
The brainfuck program ++++++++[>++++++++<-]>+. in Broccosprout.
Expected output
A
Output
- Set the first cell to 8, add 8 to the next cell 8 times, add 1 more and print 65, the letter A. brainfuck explains each command.