style: indent case branches
This commit is contained in:
parent
d0a2aaef36
commit
20af31beda
|
@ -63,7 +63,7 @@ checkString board str = go (unpack str)
|
||||||
go [] _ _ = True
|
go [] _ _ = True
|
||||||
go (c :: cs) pos dir =
|
go (c :: cs) pos dir =
|
||||||
let Just next = moveDir dir pos
|
let Just next = moveDir dir pos
|
||||||
| Nothing => False
|
| Nothing => False
|
||||||
in index next board == c && go cs next dir
|
in index next board == c && go cs next dir
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,5 +88,5 @@ export
|
||||||
solution : String -> Maybe Nat
|
solution : String -> Maybe Nat
|
||||||
solution inp =
|
solution inp =
|
||||||
let Just (_ ** _ ** board) = parseInput inp
|
let Just (_ ** _ ** board) = parseInput inp
|
||||||
| Nothing => Nothing
|
| Nothing => Nothing
|
||||||
in Just $ countString board "XMAS"
|
in Just $ countString board "XMAS"
|
||||||
|
|
|
@ -14,7 +14,7 @@ checkMS board pos =
|
||||||
let Just [ul, ur, dl, dr] =
|
let Just [ul, ur, dl, dr] =
|
||||||
map (map (`index` board))
|
map (map (`index` board))
|
||||||
$ traverse {t=Vect _} (`moveDir` pos) [UL, UR, DL, DR]
|
$ traverse {t=Vect _} (`moveDir` pos) [UL, UR, DL, DR]
|
||||||
| Nothing => False
|
| Nothing => False
|
||||||
in ((ul == 'M' && dr == 'S') || (ul == 'S' && dr == 'M')) &&
|
in ((ul == 'M' && dr == 'S') || (ul == 'S' && dr == 'M')) &&
|
||||||
((ur == 'M' && dl == 'S') || (ur == 'S' && dl == 'M'))
|
((ur == 'M' && dl == 'S') || (ur == 'S' && dl == 'M'))
|
||||||
|
|
||||||
|
@ -27,5 +27,5 @@ export
|
||||||
solution : String -> Maybe Nat
|
solution : String -> Maybe Nat
|
||||||
solution inp =
|
solution inp =
|
||||||
let Just (_ ** _ ** board) = parseInput inp
|
let Just (_ ** _ ** board) = parseInput inp
|
||||||
| Nothing => Nothing
|
| Nothing => Nothing
|
||||||
in Just $ countMAS board
|
in Just $ countMAS board
|
||||||
|
|
Loading…
Reference in a new issue