
-----------------------------------
Degensquared
Thu Jul 10, 2008 9:10 pm

Brainfuck Generator - String
-----------------------------------
This is just a program I wrote for fun recently. If you give it a string, it will output the Brainfuck code required to output that string. Just make sure that the file exists if you choose to output to file.

Enjoy!


var menuinput : string
var reply : string (1)
var filename : string
var inputstring : string := ""
var tofile : boolean := false

put "Brainfuck Generator - Output String"
put "By: Degensquared"
put "Press any key to continue."
getch(reply)
cls
put "Enter the string that you would like to be converted to bf code:"
get inputstring : *
put "output to file? (y/n)"
get menuinput
if menuinput = "y" then
    tofile := true
    put "What is the filename of the output file? (out.txt is default)"
    get filename
end if
put "Press any key to begin parsing"
getch (reply)
cls


var input : array 1 .. length (inputstring) of int
var output : string := "++++++++++[>+++>+++++++>++++++++++>+"
                checklength
                pointerloc += 1
            end for
        end if
    else
        curcell := 2
        if pointerloc < 2 then
            for j : 1 .. abs (2 - pointerloc)
                output += ">"
                checklength
                pointerloc += 1
            end for
        elsif pointerloc > 2 then
            output += "