A Brainfuck program that prints "Hello!":
[ ++ []]
+ + + <>
[>+ > <
+ + [ > - - ++
-+ + + +
+[> + +
<- ] --++
<- -+
] <-]> - +
> > . ><
<< + -
> <-+ ++
+[> ++
+ [>+ +
+<-] + -
<-
]
> <>
>+ +
.+ +
++ + - +-+ ++.+++ -
+ - -- . + + + .
<- + ++ + + + + ++
[< + + + + > -]< +. [[>
]> < > [-
] + - [ ]
- > ]
I also wrote a Brainfuck interpreter in Perl, but it proved hard to splice it into the Brainfuck program due to the commas (I could have used the "=>" alias, but it's getting late and I should go to bed). That's why it's such a horrible abomination.
local $/;@d=split //, <>;
%s=qw/[ $q++ ] $q--/;
%a=qw/+ $m[$i]++ - $m[$i]-- < $i-- > $i++ . print(chr($m[$i])) , $m[$i]=ord(getc) [ $m[$i]?push(@l,$p):&skip() ] @l?$p=pop(@l)-1:0/;
while($p<@d){eval $a{$d[$p]};$p++}
sub skip {$q=1;while($q&&$p<@d){$p++;eval $s{$d[$p]}}}