Bfcompress
Jump to navigation
Jump to search
Bfcompress is a compression algorithm made by User:Yes to compress bf code.
Process
bf command | binary conversion |
---|---|
+ | 000 |
- | 001 |
< | 010 |
> | 011 |
[ | 100 |
] | 101 |
. | 110 |
, | 111 |
2 commands can fit in one 8 bit byte. The last 2 bits are all either 01
, 10
or 11
to prevent ++
from resulting in a 00000000
or null
character.
Examples
The hello world shown on the bf page could go from
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
to
�������c�c�cKK7ccgo�WG¯{g'Ã���Û��oË;[��'''Ç''';o�c�