hi
 
I was testing my code when I came across a strange predicament. The input is a 
list of ints and a Results type which is of type 
[(int,.......),(Int......)......]. I am comparing each int from the list to the 
first element in each member of results. But it works for 1-9 but not for 10 
onwards.... why? 
Have I missed a clause anywhere...... it only does the first one after that. 
 
--Print the points of eight games
poolsPoints :: [Int] -> Results -> Int
poolsPoints [] [] = 0
poolsPoints [] _ = 0
poolsPoints _ [] = 0
poolsPoints (x:xs) ((a,b,c,d,e):t) 
| (x == a && c>d) = 1 + poolsPoints xs t
| (x == a && c<d) = 1 + poolsPoints xs t
| (x == a && c==0 && d==0) = 2 + poolsPoints xs t
| (x == a && c==d && c>0) = 3 + poolsPoints xs t
| otherwise = 0 + poolsPoints [x] t
 
Thanks
 
Ryan
_________________________________________________________________
The next generation of MSN Hotmail has arrived - Windows Live Hotmail
http://www.newhotmail.co.uk
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to