never executed always true always false
1 {-|
2 Module: Y2015.D10
3 Description: Advent of Code Day 10 Solutions.
4 License: MIT
5 Maintainer: @tylerjl
6
7 Solutions to the day 10 set of problems for <adventofcode.com>.
8 -}
9 module Y2015.D10
10 ( lookSay
11 ) where
12
13 import Data.List (group)
14
15 -- |Play the "looksay" game
16 lookSay
17 :: String -- ^ List of initial numbers
18 -> Int -- ^ Iterations
19 -> String -- ^ Resulting looksay game string
20 lookSay = (!!) . iterate (concatMap walk . group)
21 where
22 walk s@(h:_) = show (length s) ++ [h]
23 walk _ = "0"