Commit 9033825 1 parent e6619e8 commit 9033825 Copy full SHA for 9033825
File tree 7 files changed +54
-0
lines changed
7 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ def exampleInput :=
2
+ " ..."
Original file line number Diff line number Diff line change
1
+ import Aoc2024.Day10.Solve
2
+ import Aoc2024.CustomMonadLift
3
+
4
+ def main : IO Unit := do
5
+ IO.println "Day 10"
6
+ IO.println ""
7
+ IO.println "Part 1"
8
+ let exampleInput <- IO.FS.readFile "Aoc2024/Day10/inputs/example.txt"
9
+ let puzzleInput <- IO.FS.readFile "Aoc2024/Day10/inputs/input.txt"
10
+ IO.println s! "Example: { <- parseAndSolvePart1 exampleInput} "
11
+ let answerPart1 <- parseAndSolvePart1 puzzleInput
12
+ IO.println s! "Puzzle: { answerPart1} "
13
+ assert! (answerPart1 == -1 )
14
+ IO.println ""
15
+ IO.println "Part 2"
16
+ IO.println s! "Example: { <- parseAndSolvePart2 exampleInput} "
17
+ let answerPart2 <- parseAndSolvePart2 puzzleInput
18
+ IO.println s! "Puzzle: { answerPart2} "
19
+ assert! (answerPart2 == -1 )
Original file line number Diff line number Diff line change
1
+ import Aoc2024.Day10.Examples
2
+ import Aoc2024.Day10.Types
3
+ import Aoc2024.Utils
4
+ import Std
5
+ open Std.Internal.Parsec.String
6
+ open Std.Internal.Parsec
7
+
8
+ private def inputParser : Parser (List Int) := sorry
9
+
10
+ def parseInput : String -> Except String (List Int) := inputParser.run
11
+
12
+ -- #guard parseInput exampleInput == Except.ok 42
Original file line number Diff line number Diff line change
1
+ import Aoc2024.Utils
2
+ import Aoc2024.Day10.Examples
3
+ import Aoc2024.Day10.Parser
4
+ import Aoc2024.Day10.Types
5
+
6
+ -- Part 1
7
+
8
+ private def solvePart1 (input : List Int) : Int := sorry
9
+
10
+ def parseAndSolvePart1 (s : String): Except String Int := parseInput s |>.map solvePart1
11
+
12
+ -- #guard parseAndSolvePart1 exampleInput == Except.ok -1
13
+
14
+ -- Part 2
15
+
16
+ private def solvePart2 (input : List Int) : Int := sorry
17
+
18
+ def parseAndSolvePart2 (s : String): Except String Int := parseInput s |>.map solvePart2
19
+
20
+ -- #guard parseAndSolvePart2 exampleInput == Except.ok -1
Original file line number Diff line number Diff line change
1
+ import Aoc2024.Utils
You can’t perform that action at this time.
0 commit comments