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-02 20:53

import Data.List

let f = [""] ++ map (\x -> [x]) ['a'..'z'] in mapM_ print $ nub $ sort $ tail [a++b++c++d++e|a<-f,b<-f,c<-f,d<-f,e<-f]


No, it's not a loop.

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