News for hackers. Stuff that matters.
Re:Brainfuck interpreter in 160 bytes of C by dmoney on Monday September 27, 2010 @07:18AM (#1731303)

  // with whitespace:

  s[999], *r=s, *d, c;
  
  main(a, b)
  {
      char *v=1[d=b];
      for(;c = *v++ % 93;)
          for(b = c%7 ? 
                  a &&
                      (c & 17 ? 
                            c & 1 ? 
                                (*r -= c - 44)
                                :(r += c - 61)
                             :c & 2 ?
                                putchar(*r)
                                :(*r = getchar())
                      ,0)
                  :v;
              b&&c | a * *r;
              v=d)
                  main(!c,&b-1);
      d = v;
  }
Re:Brainfuck interpreter in 160 bytes of C by coldnose on Saturday October 02, 2010 @07:53PM (#1751677)
Re:Brainfuck interpreter in 160 bytes of C by ramki on Monday September 27, 2010 @05:54AM (#1731162)
That is more than two lines of code obfuscated into two lines... but i like his idea to make this tiny enough to fit in a tweet.
Re:Brainfuck interpreter in 160 bytes of C by pinksoda on Monday September 27, 2010 @01:47PM (#1732532)
140 is the limit for tweets so that they can fit your username.
Re:Brainfuck interpreter in 160 bytes of C by wglb on Saturday October 02, 2010 @05:30PM (#1751406)
Cool.

I have been programming in C for a while, and can't recall ever seeing main called recursively. Neat.

Re:Brainfuck interpreter in 160 bytes of C by __bjoernd on Monday September 27, 2010 @09:04AM (#1731508)
I actually prefer readable code, but I accept that others appreciate small size as well.
Re:Brainfuck interpreter in 160 bytes of C by lifthrasiir on Monday September 27, 2010 @04:40PM (#1733313)
I'm an original author of the code and I made it out of curiosity, not for other reasons. I also prefer readable (and concise) code in general, but shortening the code is a very different matter -- it is a sport (sometimes called code golfing) and not necessarily connected to good programming skills. And note that I have spent (and had to spend) only 24 hours to do it: code golfing is very time-consuming and 24 hours are often short for this standard. ;)

For the Brainfuck interpreter, I was also motivated by this StackOverflow question: http://stackoverflow.com/questions/1053931/code-golf-shortes... In this sense it does have a practical implication to gauge the minimal possible Turing-complete language implementation.

Re:Brainfuck interpreter in 160 bytes of C by jhuckestein on Monday September 27, 2010 @09:29AM (#1731590)
Who cares about tweets? It fits a text.