int a = {0,1,2,3};
int b = 2;
char c = 2;
printf("%d %d\n", b[a], c[a]);
"5. A man pushed his car to a hotel and lost his fortune. What happened?"[...] if you don't know, no amount of problem solving or creative thinking will get you to the correct answer.
pascal = iterate (\row -> zipWith (+) ([0] ++ row) (row ++ [0])) [1]Just don't let its clarity and simplicity tempt you into point-free form :
pascal = iterate (ap (zipWith (+) . (0 :)) (++ [0])) [1]Via the Haskell wiki's Blow your mind. See also The Evolution of a Haskell Programmer.
« Older The New Dealers... | So if I'm thinking about this ... Newer »
This thread has been archived and is closed to new comments
posted by fnerg at 7:16 PM on December 26, 2011 [5 favorites]