Harmful Brainfuck

From Esolang
Jump to: navigation, search

Harmful Brainfuck is a brainfuck derivative intended, but failing, to make brainfuck easier to program in. It is based on the observation that brainfuck corresponds to "structured programming" since it uses a while loop. According to the Kosaraju hierarchy structured programming is harder than programing with goto (it may require introducing extra booleans to exit complicated nested loops, there are programs whose code size blows up a lot when you do not have goto and so on).

Therefore Harmful Brainfuck replaces [] with the computed jump operator * which moves the program counter by the offset given by the current tape cell (an offset of 0 will loop forever). Harmful Brainfuck is believed not to be Turing-complete.

Sample Program

The following is a ROT13 program that works for ASCII and loops forever on EOF.

-------------------------------------------------------------------------------------------------------------------------------->
+>
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++>
+++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+>
++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<<<<<<<<
trampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetrampolinetra
>>,
*                                                               >A           >N           >[    >a           >n           >{   >*<<<<<-------------------------->>>>>><<<<<<+++++++++++++>>>>>>><<<<<<<.<<fillerfillerfillerfillerfillerfillerfillerfillerfiller*

External resources