aouwt / THIS-IS-NOT-A-BRAINFUCK-DERIVATIVE

Ignore the title. Yes, this is a brainfuck derivative.
1 stars 0 forks source link

i think i lost the interpreter code...... #1

Open aouwt opened 2 years ago

aouwt commented 2 years ago

shit.

bneils commented 2 years ago

oof

rdebath commented 4 months ago

Here you are ...

#!/usr/bin/ruby
h = {
    'THIS IS NOT A BRAINFUCK DERIVATIVE' => 'm[p]+=1;',
    'IT HAS NOTHING TO DO WITH BRAINFUCK' => 'm[p]-=1;',
    'IT NEVER WAS' => 'p+=1;',
    'IT NEVER WILL BE' => 'p-=1;',
    'SHUT UP YOU LITTLE BITCH' => '(',
    'SHUT THE FUCK UP' => ')while((m[p]&=255)!=0);',
    'TO ANYBODY WHO SAYS THIS IS A BRAINFUCK DERIVATIVE:' => 'putc m[p];',
    'FUCK YOU' => 'm[p]=STDIN.getbyte if !STDIN.eof;'
}
r = Regexp.union(Regexp.union(h.keys.sort{|a,b|b.length<=>a.length}),/./);
eval 'm=Hash.new(p=0);'+ARGF.read.gsub(/[\n\t ]+/," ").gsub(r,h);