[Haskell-cafe] recursion issues...
ryanbloor at hotmail.com
Sat Nov 10 11:54:21 EST 2007
I was wondering how I would get the second function do recursively do the function for poolNews xs.... tried that and it fails.
--Give wins, draws a rating.
poolNews :: Result -> PoolNews -> PoolNews
poolNews (a,b,c,d,e) (home,away,goaless,scoredraw)
| c > d = (home+1,away,goaless,scoredraw)
| c < d = (home,away+1,goaless,scoredraw)
|(c == 0) && (d == 0) = (home+1,away,goaless+1,scoredraw)
| otherwise = (home,away,goaless,scoredraw+1)
--Do for all Results
poolNewsB :: Results -> PoolNews
poolNewsB (x:xs) = poolNews x (0,0,0,0)
Celeb spotting – Play CelebMashup and win cool prizes
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe