oftn-bot icon indicating copy to clipboard operation
oftn-bot copied to clipboard

Implement brainfuck language support

Open devyn opened this issue 13 years ago • 6 comments

< devyn> bf> ++++++++++[>++++++++++<-]+++[>>++++++++++<<-]>++++.+.>++.<----.---.+++++++++++++.++++++++++. 
< oftn-bot> devyn: [0, 32, (121)] hi eboy

Not really sure how input would work. Maybe just give it the next thing they say if it's hanging on a ',' command.

devyn avatar Nov 10 '12 07:11 devyn

Brainfuck programs get big really quickly. Aren't we gonna hit the IRC message length?

mathiasbynens avatar Nov 10 '12 09:11 mathiasbynens

Doesn't matter; has brainfuck.

Really though, you can do enough interesting things in a single IRC-line of brainfuck for it to be a fun (although gimmicky) feature.

FireyFly avatar Nov 10 '12 19:11 FireyFly

Hi chaps-

Doesn't matter; has brainfuck.

What about the inevitable infinite loops? +[]?

Alistair

prophile avatar Nov 10 '12 20:11 prophile

Re. infinite loops, just limit the execution to, say, 100 000 brainfuck instructions.

Not really sure how input would work.

IIRC what fungot (another IRC bot) does is to separate code and input by a '!'.

FireyFly avatar Nov 10 '12 20:11 FireyFly

Separating code and input by a ! is something a bunch of things do, especially self-interpreters.

emberian avatar Nov 11 '12 00:11 emberian

We already have multiline execution support:

|> +++[>
|>   ++++++++++
|> <]
bf> ++.

This works for all languages.

As for input, yes, ! seems the best way to go. I had forgotten about that.

devyn avatar Nov 11 '12 01:11 devyn