-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def exampleInput := | ||
"..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Aoc2024.Day05.Solve | ||
import Aoc2024.CustomMonadLift | ||
|
||
def main : IO Unit := do | ||
IO.println "Day 05" | ||
IO.println "" | ||
IO.println "Part 1" | ||
let exampleInput <- IO.FS.readFile "Aoc2024/Day05/inputs/example.txt" | ||
let puzzleInput <- IO.FS.readFile "Aoc2024/Day05/inputs/input.txt" | ||
IO.println s!"Example: {<- parseAndSolvePart1 exampleInput}" | ||
let answerPart1 <- parseAndSolvePart1 puzzleInput | ||
IO.println s!"Puzzle: {answerPart1}" | ||
assert! (answerPart1 == -1) | ||
IO.println "" | ||
IO.println "Part 2" | ||
IO.println s!"Example: {<- parseAndSolvePart2 exampleInput}" | ||
let answerPart2 <- parseAndSolvePart2 puzzleInput | ||
IO.println s!"Puzzle: {answerPart2}" | ||
assert! (answerPart2 == -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Aoc2024.Day05.Examples | ||
import Aoc2024.Day05.Types | ||
import Aoc2024.Utils | ||
import Std | ||
open Std.Internal.Parsec.String | ||
open Std.Internal.Parsec | ||
|
||
private def inputParser : Parser (List Int) := sorry | ||
|
||
def parseThings : String -> Except String (List Int) := inputParser.run | ||
|
||
-- #guard parseReports exampleInput == Except.ok 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Aoc2024.Utils | ||
import Aoc2024.Day05.Examples | ||
import Aoc2024.Day05.Parser | ||
|
||
private def solvePart1 (things : List Int) : Int := sorry | ||
|
||
def parseAndSolvePart1 (s : String): Except String Int := parseThings s |>.map solvePart1 | ||
|
||
-- #guard parseAndSolvePart1 exampleInput == Except.ok 2 | ||
|
||
private def solvePart2 (things : List Int) : Int := sorry | ||
|
||
def parseAndSolvePart2 (s : String): Except String Int := parseThings s |>.map solvePart2 | ||
|
||
-- #guard parseAndSolvePart2 exampleInput == Except.ok 4 |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters