From: Simon Strandgaard Date: 2006-08-10T02:44:00+09:00 Subject: Re: Codegolf - Writing a Brainf*ck interpreter On 8/9/06, Daniel Martin wrote: [snip] > Still, there's supposedly another way to squeeze an additional 50 > characters out, which I think is going to require some sort of > fundamental shift in the approach to the problem. I have just given it a shot.. 146 bytes prompt> ruby bf.rb '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' Hello World! prompt> ruby bf.rb ',[.,]'this program echoes its input this program echoes its input only 146 bytes! only 146 bytes! ^Cbf.rb:3: (eval):5:in `getc': (Interrupt) from (eval):5 prompt> cat bf.rb eval 'd=[i=0]*8**5'+ARGV[0].gsub(/./){" "+%w[i+=1 X+=1 i-=1 X-=1 print(X.chr) X=STDIN.getc end while(X>0)]['>+<-.,]['.index($&)]}.gsub(/X/,'d[i]') prompt> -- Simon Strandgaard