OK - earlier today I said that I was going to stop messing about with ASCII and Brainfuck…
Well, I lied.
Ladies and gentlemen, boys and girls, please put your hands together for the amazing
Brainfuck ASCII art message concealer!
“What does it do though Tom?” - Put simply, it hides text inside an image of your choice. To do this, does the following:
- First it creates the Brainfuck script for the text you supply
- Next it creates an ASCII version of the picture (default or user supplied)
- Third is replaces the non-brainfuck ASCII characters with the brainfuck script, in order, and with respect to the brightness of each ‘pixel’.
Still confused? Don’t worry - Brainfuck is just a really minimalist programming language. Here it is on Wikipedia and in the 99 Bottles repository.
I’d like to thank Jonathan Ford for writing the class on which the ASCII picture generator is based.
Source files:
- BF_text class
- Modified ASCII class
And, because I’m feeling reckless, a snippet:
private function conceal ($char) { if (($this->pointer < count($this->msgarray))&&(in_array($char, $this->matches[$this->msgarray[$this->pointer]]))) { $char = $this->msgarray[$this->pointer]; $this->pointer++; } return $char; }
How’d you like them apples? I’m tired now, and am going to bed.
You’ve been wonderful,
Tom x