[ encodetext.bf - Don Yang (uguu.org) Given text data in stdin, generate BF program that will output the same text data. 09/02/04 ] Initialize +++++[->++++++++ [>+>+>+<<<-] <] >>+++ >+++++ >++++++ |0 0 43 45 46 ^ >+> |0 0 43 45 46 c=1 ^ Process loop (characters are stored as ASCII plus 1) ,+[ |0 0 43 45 46 c ^i >[-]>[-]>[-]>[-]>[-]>[-]>[-]>[-] <<<<<<<< |0 0 43 45 46 c ^i 0 0 0 0 0 0 0 0 Copy input value [>+>+<<-] Copy current char <[->>>>+>+<<<<<] >>>>[-<<<<+>>>>>>+<<] > |0 0 43 45 46 c 0 i i 0 ^c c 0 0 Compare current char with input char [ - >>+<<<<- [ >>>>- <<<<<< ] <<<<[<] >>>>>>>>> ] |0 0 43 45 46 c 0 i ? 0 ^0 c cmp 0 Make ? positive (for nonoptimizing BF interpreters) ++++[<++++++++[<++++++++>-]>-] |0 0 43 45 46 c 0 i a256 0 ^0 c cmp 0 >>>+< |0 0 43 45 46 c 0 i ? 0 0 c ^cmp 0 [ Current char greater than or equal to input >-<< |0 0 43 45 46 c 0 i ? 0 0 ^c 1 0 <<<<[->>>>-<<<<] >>>> |0 0 43 45 46 c 0 0 ? 0 0 ^d 1 0 Output minus [<<<<<<<<.>>->>>>>>-] >- |0 0 43 45 46 i ^0 0 ? 0 0 0 ^0 0 ] >[ Current char less than input << |0 0 43 45 46 c 0 i ? 0 0 ^c 0 1 [-<<<<->>>>] <<<< |0 0 43 45 46 c 0 ^d ? 0 0 0 0 1 Output plus [<<<<<.>>>+>>-] >>>>>>- |0 0 43 45 46 i 0 0 ? 0 0 0 0 ^0 ] Output dot <<<<<<<<<.>> ,+] Newline at the end ++++++++++.