refactor: Data.Vect.range
-> Data.List.allFins
This commit is contained in:
parent
3826a13244
commit
22423f6cf6
|
@ -1,5 +1,6 @@
|
|||
module Day4.Part1
|
||||
|
||||
import Data.List
|
||||
import Data.String
|
||||
import Data.Vect
|
||||
|
||||
|
@ -59,8 +60,8 @@ checkString board str = go (unpack str)
|
|||
export
|
||||
findChar : {h, w : _} -> Board h w -> Char -> List (Pos h w)
|
||||
findChar board c = do
|
||||
i <- toList $ range {len=h}
|
||||
j <- toList $ range {len=w}
|
||||
i <- allFins h
|
||||
j <- allFins w
|
||||
guard (index (i, j) board == c)
|
||||
pure (i, j)
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ covering
|
|||
loopPos : {h, w : _} -> (Pos h w, Direction) -> Map h w
|
||||
-> List (Pos h w)
|
||||
loopPos g mp = do
|
||||
i <- toList $ range {len=h}
|
||||
j <- toList $ range {len=w}
|
||||
i <- allFins h
|
||||
j <- allFins w
|
||||
let obs = (i,j)
|
||||
guard (obs /= fst g && not (index obs mp)) -- must be empty space
|
||||
let cols = getCollisions g $ insertObs obs mp
|
||||
|
|
Loading…
Reference in a new issue