views:

283

answers:

3

Please identify this programming language:

*Main> [ ((a,b,c),(d,e)) | 
    a <- [1..7], 
    b <- [2..8], 
    c <- [3..9], 
    d <- [1..8], 
    e <- [2..9], 
    a < b, 
    b < c, 
    d < e, 
    List.intersect [d,e] [a,b,c] == [], 
    a+b+c == 23, 
    d+e == 10 ]

output:

[((6,8,9),(3,7))]

I found the code in this blog comment.

+3  A: 

Haskell. Definitely.

Jared Updike
+7  A: 

Haskell, running in a GHCi session.

alt text

KennyTM
How did you type this with less than 15 characters? :-)
Jared Updike
@Jared: HTML comments.
KennyTM
@KennyTM: The multi-line GHCi trick is great. Now I know.
Jared Updike
+3  A: 

Haskell, of course

Gabi Purcaru