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

/prog/ Challenge #9002

Name: Anonymous 2011-05-02 20:12

The task:

Print strings from "a" to "zzzzz" without using any loop or conditional statements. Don't just write all 1000 permutations out by hand. The output should look like this:
a
b
c
...
aa
ab
ac
...
zzzzx
zzzzy
zzzzz


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

Name: Anonymous 2011-05-03 7:57

>>23
I have to admit that you might be correct here. I could have also used a recursion with main() (or rather a separate function) instead of the goto here, though, which, by definition, is not a loop, but gets unstable on my machine and quits after ~37000 loops, so I'd rather use the goto.

Anyways, both most likely create a JMP in asm, anyway. I'm not even sure if this is possible without, since we're basically talking about a looping/repeating behaviour (PRINT(X) Y TIMES)...

>>22
>By connecting SIGFPE to an exit function
If you tell me how, I'll do it :3
Breaking out by causing a div by zero is working but getting a runtime error isn't so nice.

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