Permalink
Browse files

fix issue #9 on kosmikus' fork (High score table, number of steps)

  • Loading branch information...
1 parent 96a3f1e commit de46aad7bf43244f75d8cbb4e3943329533dfce9 @Mikolaj Mikolaj committed Jan 31, 2011
Showing with 12 additions and 10 deletions.
  1. +12 −10 src/HighScores.hs
View
@@ -61,18 +61,20 @@ instance Binary ScoreRecord where
-- | Show a single high score.
showScore :: (Int, ScoreRecord) -> String
showScore (pos, score) =
- let won = if victor score
- then "emerged victorious"
- else "is camping on level " ++ show (current score) ++ ","
- died = if killed score
- then "perished on level " ++ show (current score) ++ ","
- else won
- time = calendarTimeToString . toUTCTime . date $ score
- big = " "
- lil = " "
+ let won = if victor score
+ then "emerged victorious"
+ else "is camping on level " ++ show (current score) ++ ","
+ died = if killed score
+ then "perished on level " ++ show (current score) ++ ","
+ else won
+ time = calendarTimeToString . toUTCTime . date $ score
+ big = " "
+ lil = " "
+ -- TODO: later: https://github.com/kosmikus/LambdaHack/issues#issue/9
+ steps = negTurn score `div` (-10)
in
printf "%s\n%4d. %6d This hero %s after %d steps \n%son %s. \n"
- big pos (points score) died (- (negTurn score)) lil time
+ big pos (points score) died steps lil time
-- | The list of scores, in decreasing order.
type ScoreTable = [ScoreRecord]

0 comments on commit de46aad

Please sign in to comment.