whoopsies! this code crashed on certain datasets before
This commit is contained in:
parent
33b2da66c3
commit
a1776f40c9
2
5-a.hs
2
5-a.hs
|
@ -5,7 +5,7 @@ import GHC.Utils.Misc (chunkList)
|
|||
import Data.Char (isSpace, isNumber)
|
||||
|
||||
rotate2DList :: [[a]] -> [[a]]
|
||||
rotate2DList l = map (\i -> map (!! i) l) [0 .. length l]
|
||||
rotate2DList l = map (\i -> map (!! i) l) [0 .. length (head l) - 1]
|
||||
|
||||
parseState :: String -> [[Char]]
|
||||
parseState = map (dropWhile isSpace) . rotate2DList . map (map (!! 1) . chunkList 4) . init . lines
|
||||
|
|
2
5-b.hs
2
5-b.hs
|
@ -5,7 +5,7 @@ import GHC.Utils.Misc (chunkList)
|
|||
import Data.Char (isSpace, isNumber)
|
||||
|
||||
rotate2DList :: [[a]] -> [[a]]
|
||||
rotate2DList l = map (\i -> map (!! i) l) [0 .. length l]
|
||||
rotate2DList l = map (\i -> map (!! i) l) [0 .. length (head l) - 1]
|
||||
|
||||
parseState :: String -> [[Char]]
|
||||
parseState = map (dropWhile isSpace) . rotate2DList . map (map (!! 1) . chunkList 4) . init . lines
|
||||
|
|
Loading…
Reference in New Issue