Click to See Complete Forum and Search --> : Brainf*ck examples
sans-hubris
12-06-2001, 01:12 PM
I need some Brainf*ck sample programs with some clearly defined output, any kind of output that would signify that the interpreter/compiler that a person wrote works. However, it can't have any nested loops. I'm basically writing a challenge for a high school programming competition that my college is hosting and I'm having a hard time coming up with some Brainf*ck sample programs that don't have nested loops and have some clearly defined output.
jemfinch
12-06-2001, 05:18 PM
I have no earthly clue what they do (nested loop-wise and all,) but if you look for "quines" in brainf*ck, you can easily tell if a compiler is correct by comparing the output to the program itself (quines being programs that output themselves.)
Jeremy
George Kilroy
12-06-2001, 07:22 PM
Originally posted by jemfinch:
<STRONG>...quines being programs that output themselves.</STRONG>
I made a simple Python script the other day that grabs whatever file you type in the command line and prints that out. Ex.
# ./Smc.py message.txt
of cource
# ./Smc.py Smc.py
prints out the source to itself.
Is that a quine?
[ 06 December 2001: Message edited by: George Kilroy ]
jemfinch
12-07-2001, 05:01 AM
No, that's not a quine.
Jeremy