Fix indentation
This commit is contained in:
16
src/Day07.hs
16
src/Day07.hs
@@ -45,11 +45,13 @@ beamSplitRecursive start = do
|
|||||||
else
|
else
|
||||||
if grid !! fst start !! snd start == 'S' || grid !! fst start !! snd start == '.'
|
if grid !! fst start !! snd start == 'S' || grid !! fst start !! snd start == '.'
|
||||||
then beamSplitRecursive (fst start + 1, snd start)
|
then beamSplitRecursive (fst start + 1, snd start)
|
||||||
else if grid !! fst start !! snd start == 'x' then return ()
|
else
|
||||||
else do
|
if grid !! fst start !! snd start == 'x'
|
||||||
mark start
|
then return ()
|
||||||
beamSplitRecursive (fst start, snd start - 1)
|
else do
|
||||||
beamSplitRecursive (fst start, snd start + 1)
|
mark start
|
||||||
|
beamSplitRecursive (fst start, snd start - 1)
|
||||||
|
beamSplitRecursive (fst start, snd start + 1)
|
||||||
|
|
||||||
beamSplit :: State Grid ()
|
beamSplit :: State Grid ()
|
||||||
beamSplit = do
|
beamSplit = do
|
||||||
@@ -62,5 +64,5 @@ day07_1 = do
|
|||||||
input <- parseInput
|
input <- parseInput
|
||||||
let grid = execState beamSplit input
|
let grid = execState beamSplit input
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Day 7, Puzzle 1 solution: "
|
"Day 7, Puzzle 1 solution: "
|
||||||
++ show (length $ concatMap (filter (== 'x')) grid)
|
++ show (length $ concatMap (filter (== 'x')) grid)
|
||||||
|
|||||||
Reference in New Issue
Block a user