4 / 4
Dec 2012

Some problems on the SPOJ can only be solved in Brainf**k using the bff interpreter. I keep getting some errors with codes i think that are right. for example:
this code:
,[->,+]<[.<]
run with this input:
asdf
works properly on the bff generating the output:
fds`
while this one:
,+[->,+]<[.<]
running with the same input prints on stderr the message: "bff: out of memory (985548044)"
I have downloaded the bff version 1.0.3.1 (which is the one at spoj) and run examples in my computer, getting similar errors. the same interpreter is also available at ideone.com

I wrote a simple (and very slow) interpreter for brainfuck here: pastebin.com/sFxDSB3X maybe we (as a community) could work on a better version for the bff interpreter.
--
Kindly,

  • created

    Feb '11
  • last reply

    Dec '12
  • 3

    replies

  • 443

    views

  • 4

    users

  • 2

    links

5 months later

I'm having the same troubles with SPOJ's and ideone's BFF interpreter.

In ideone, even this "echo" code taken from wikipedia's Brainf*ck article is crashing:

,+[-.,+]

So is there any fix?

21 days later

I guess there is a bug within bff-1.0.3.1 as array `x' in main() is not initialized after allocated. I made a patch to it,

$ diff bff.c bff-corrected.c
106a107
> 	memset(x, 0, n * sizeof(*x));

And this should solve the problem.
EDIT: it is now fixed in latest version, bff-1.0.4. We should urge SPOJ admins to upgrade it. @admins

1 year later