Root / Submissions / [.]
This is a Brainf*ck to SmileBasic compiler, meaning, it takes Brainf*ck code such as this Hello World program: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. and compiles it into a SmileBasic program and saves it as a PRG file, ready to run. The Brainf*ck:SmileBasic instruction ratio is about 1.8:1, which means that every 1.8 Brainf*ck commands are compiled into 1 SmileBasic command. This number is an approximation, so some programs might have a 5:1 ratio, while others could have a 1:1 ratio.
Just from reading the instructions (I don't do BrainF***), I have a suggestion: Maybe be able to compile a program from a different slot? So that you can have many lines and have a larger max length. Plus you could easier edit the pre-compiled program.
Very interesting suggestion, and I will definitely think on that! I can easily see that as a possibility.
I know this program is old, but I found a solution for compiling a Brainf*ck program from a file. Replace the contents of DEF MAIN with the following:
DEF MAIN VAR L$ VAR S$ INPUT "Name of program to compile"; L$ LOAD "PRG2:" + L$, 0 PRGEDIT 2 S$=PRGGET$() COMPILE S$ RUNPRG ENDThis basically (no pun intended) allows you to make Brainf*ck programs in the editor. You can also send Brainf*ck programs from your computer. Just make sure all Brainf*ck code is on one line (specifically, the first). By the way, entering an invalid file name will show an error, but still compile whatever’s in Slot 2, so you can do that if you would like to create Brainf*ck programs in the editor without saving. I would recommend saving the edited version of the compiler as a different program, so you can still use the original if you’re compiling a small program (I named the edited version BRAINFFROMFILE).