Question

A professor of mine has said he'll accept homework assignments in any language we'd care to use. I'm on good enough terms that I'd like to mess with him a bit and submit a valid homework assignment using brainfuck, whitespace, or some equally "useful" language.

I have the C-sources for a few simple numerical analysis routines as well as the compiled output and the assembly files they generate.

Does anyone know of a decompiler (or a C->brainfuck translator) that could give me something akin to the "brainfuck source code"?

Was it helpful?

Solution

Just use APL or J.

Unlike BF, they were actually designed to serve a "useful" (and not a "useful as in BF" sense) purpose - and yet can easily make Perl code-golf entries look like novels. (The dedication and mental training to enjoy these languages is currently more than my skill/effort levels.)

If the goal is using a purely esoteric language, I have always enjoyed the look of Piet programs. It looks prettier and is actually able to solve common CS homework problems. Following the links will reveal "Piet assemblers" and other tools. Win.

Happy coding.

OTHER TIPS

For what it's worth, I just wrote a very simple Brainfuck Assembler (inspired by this SO post actually), which assembles readable source code (not C, just something simple and nameless) to BrainFuck. The source-code and compilation/usage instructions can be found here: BrainFuck Assembler.

Edit: The project has recently been updated under a new name: BrainFix.

A quick Google search brings up the (a?) Brainfuck site, which links to an archive with "all things Brainfuck". I doubt there's a C->brainfuck translator anywhere, I wouldn't think anyone would invest that much time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top