Skip to content

Commit

Permalink
sorted the high score list in decreasing order of wins
Browse files Browse the repository at this point in the history
  • Loading branch information
creswick committed Oct 5, 2012
1 parent 1da5afb commit b8c4dbd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Server.hs
Expand Up @@ -4,8 +4,9 @@ module Server (serverMain) where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Data.List (intercalate)
import Data.List (intercalate, sortBy)
import Data.Foldable (for_)
import Data.Function (on)
import Data.Maybe (fromMaybe)
import Data.Time.Clock (diffUTCTime, getCurrentTime)
import Graphics.Gloss.Data.Point
Expand Down Expand Up @@ -180,7 +181,7 @@ updateServerWorld hs t w
$ commas (map playerUsername winners) ++ " wins!"
announce hs
$ ServerMessage
$ commas $ map prettyScore ps
$ commas $ map prettyScore $ reverse $ sortBy (compare `on` playerScore) ps
return ps

npcs' <- mapM (updateNPC hs t True) $ serverNpcs w
Expand Down

0 comments on commit b8c4dbd

Please sign in to comment.