Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Challenge 9001

Name: Anonymous 2011-05-01 19:51

The correct title of this article is /prog/ Challenge 9001. It appears incorrectly here because of technical restrictions.

The task:

Print numbers from 1 to 1000 without using any loop or conditional statements. Don't just write the printf() or cout statement 1000 times.

inb4 lipthfags and dead dogs using some obscure functionality of their obscure languages.

Name: Anonymous 2011-05-02 12:16

>>68
Here's a version that doesn't quit with an error:
from subprocess import call
from sys import argv, exit

n = int(' '.join(argv[1:] + ['1']).split()[0])
print n
([lambda: 0] * 1000 + [exit])[n]()
call(['python', argv[0], str(n + 1)])


And the code module is stupid and I hate it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List