thomas_bevan wrote:
>
> Seeing as its thst time of year again and everyone is posting their
> homework, has anyone got any good puzzles to do?
> I wouldn't mind having a go at something a bit tricky.

Here's one: figure out what the following does :-)

puzzle = (!!) $ map (1:) $ iterate (s (lzw (+)) (1:)) [] where
    s f g x = f x (g x)
    lzw op xs [] = xs
    lzw op [] ys = ys
    lzw op (x:xs) (y:ys) = op x y : lzw op xs ys


(No fair trying it out in Hugs first...)

--Joe English

  [EMAIL PROTECTED]
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to