aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Types
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-23 06:07:44 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-23 06:07:44 +0000
commitf547469c4b1e16fa6715d7d10c226f16b5d3b0e2 (patch)
tree73e20ddbfa4746cbd4b5a8a212ecec372337ad2f /src/Types
parent38107bbadb1739e17afe9886ee6a7d31368c1be2 (diff)
downloadsariulclocks-f547469c4b1e16fa6715d7d10c226f16b5d3b0e2.tar.gz
update sariulccgi.hs to use new monad
Diffstat (limited to 'src/Types')
-rw-r--r--src/Types/Classes.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Types/Classes.hs b/src/Types/Classes.hs
index bcf487c..529cf64 100644
--- a/src/Types/Classes.hs
+++ b/src/Types/Classes.hs
@@ -32,8 +32,8 @@ getModifier :: Class -> Float
getModifier (Class (GradeFive m) _ _) = m
getModifier (Class (GradeSix m) _ _) = m
-updateScore :: ScoresList -> Class -> Int -> Int -> ScoresList
-updateScore [] _ _ _ = []
-updateScore (s@(aClass, Score x y):ss) c p t
+updateScore :: Class -> Int -> Int -> ScoresList -> ScoresList
+updateScore _ _ _ [] = []
+updateScore c p t (s@(aClass, Score x y):ss)
| c == aClass = (c, Score (x + (floor $ (fromIntegral p) * (getModifier aClass))) (y + t)):ss
- | otherwise = s:updateScore ss c p t
+ | otherwise = s:updateScore c p t ss