Day 5 Part 2
This commit is contained in:
@@ -6,6 +6,8 @@ import Text.Heredoc
|
||||
import qualified Data.Sequence as S
|
||||
|
||||
import Day5.Part1
|
||||
import Day5.Part2
|
||||
import Day5.Shared
|
||||
|
||||
inputPart1 :: String
|
||||
inputPart1 = [str| [D]
|
||||
@@ -72,4 +74,11 @@ spec =
|
||||
findTopOfStacks row `shouldBe` S.fromList "NDP"
|
||||
it "solves the demo" $ do
|
||||
day5_1 inputPart1 `shouldBe` "CMZ"
|
||||
describe "Part1" $ do
|
||||
it "executes 9001 operations on a row" $ do
|
||||
let op = Operation { count = 2, from = StackIndex 2, to = StackIndex 3}
|
||||
let row = S.fromList [Stack "NZ", Stack "DCM", Stack "P"]
|
||||
execute9001Operation row op `shouldBe` S.fromList [Stack "NZ", Stack "M", Stack "DCP"]
|
||||
it "solves the demo" $ do
|
||||
day5_2 inputPart1 `shouldBe` "MCD"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user