views:

416

answers:

7

Does anyone remember years ago in magazines like Byte where people competed to produce the most functional piece of code written in a single line of code? I remember games like Pole Position with scrollng text, etc. and fractal graphics being done this way.

Granted modern languages like C# and Java an endless amount in one statement, does anyone know of anything similar going on now? It was also inspiring and interesting stuff to see.

+1  A: 

Code Golf on SO is a great for these types of challenges

Gavin Miller
+1  A: 

Check out any of the questions here tagged 'code-golf' for some interesting stuff!

Andy Mikula
+1  A: 

There is commandlinefu.com -- good to type quickly on the shell.
But, I like code written to be more readable.

nik
+4  A: 

There's a site called Code Golf dedicated to competing on problems in that format.

Bill the Lizard
A: 

Well I guess technically, you could write almost anything as one line of code if the language ignored white space.

Maybe some sort of HTML or web app?

How about a gigantic blob of C code?

samoz
Most folks would consider "a = b; c = d;" to be *two* lines of C code, even though they may be on the same textual line.
T.E.D.
A: 

I wouldn't consider that a very good exercise, as functional languages like Lisp are going to have an inherent advantage.

The old joke about APL is that you can write an entire OS in one line, but nobody could read it.

T.E.D.
A: 

If you go to Project Euler and solve the problems one-by-one, the forums will have people trying to code-golf their solutions. (i.e for Problem 1, got to this forum)

pageman