Commits

Luke Plant  committed a4c4277

Added some comments

  • Participants
  • Parent commits f604add

Comments (0)

Files changed (1)

File phone2word.hs

      findRoutes' :: WordList -> Int -> Int -> [Combo]
      findRoutes' words start end =
          do
+           -- find words that start as position 'start':
            ((p,len),ws) <- filter (\((p,_),_) -> p == start) words
            w <- ws
            if p + len == end
-              then return [w]
+              then return [w] -- last segment
               else do
                 c <- findRoutes' words (start + len) end
+                -- don't add multiple 'digit words':
                 guard (hasWord w || (hasWord $ head c))
                 return (w:c)