Skip to content

emlun/bob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Backward Output Brainfuck

Nerd sniped myself after seeing this Code Golf answer. This script takes input on STDIN and outputs a Brainfuck program that outputs the input. It also accepts an optional command line argument that specifies the line with of the output (default: 80).

Example:

$ echo '      ++++         +++
    +[>++++    ++[>+<-][
   <]<  -]>   >++    +++
  +.-   ---   ---    ---
 --.+++++++         +++
        +++       .++
        +++      +.-
        ---    -----.--.' | python backward_output_bf.py

Output:

++++++++++[->+>+<<]>>[-<<+>>]<++++++++++++++++++++++[->+>+<<]>>[-<<+>>]<++++++++
+++[->+>+<<]>>[-<<+>>]<++[->+>+<<]>>[-<<+>>]<+[->+>+<<]>>[-<<+>>]<++++++++++++++
[->+>+<<]>>[-<<+>>]<++[->+>+<<]>>[-<<+>>]<+++++++++++++++++++++++++++++[->+>+<<]
>>[-<<+>>]<++[->+>+<<]>>[-<<+>>]<<<<<<<<<......>....<.........>...<<.>....>.>>>>
>.<.<<<<....<....>..>>>>>.<.<<<<.>>>.<<.>>>>>.<.<<<<<<<.>...>>>>.>>>.<<<.<<<<..>
>.>>>>>.<<.<<<<<...>>>>>.<<<<..<....>...<<.>..>.>>.<.<<...>>...<<...>>...<<....>
>...<<<.>.>>..>.<<.......<.........>...<<.>........>...<.......>>>.<<..<<.>.....
...>...<......>.>>.<.<<<.>........>>...<<....>>.....>.<..>.

Which in turn outputs:

      ++++         +++
    +[>++++    ++[>+<-][
   <]<  -]>   >++    +++
  +.-   ---   ---    ---
 --.+++++++         +++
        +++       .++
        +++      +.-
        ---    -----.--.

License

GNU General Public License, version 2 or later.

About

Backward Output Brainfuck

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages