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 4:59

>>43
Recursion can be equivalent to looping, it's still control-flow. The basic loop itself is nothing more than a jump to the start of a block that would eventually read the jump to the loop. Recursion with TCO is completly equivalent to it, goto is equivalent to it, recursion without TCO is very close to it (stack increases).
>>45
It's an indirect transfer of control, which makes it perfectly capable of looping.

OP may not consider those loops, but they were as much loops as normal ones (yes, this includes mapping constructors, declarative ones, generators and so on).

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