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
// Advent of Code 2023. Day 19: Aplenty | |
// dotnet fsi aoc19.fsx | |
open System | |
open System.IO | |
open System.Text.RegularExpressions | |
type Part = { | |
x : int | |
m : int |
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
// Advent of Code 2023. Day 18: Lavaduct Lagoon | |
// dotnet fsi aoc18.fsx | |
open System | |
open System.IO | |
type Direction = U | D | L | R | |
type Pos = { x : int64; y : int64 } |
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
// Advent of Code 2023. Day 17: Clumsy Crucible | |
// dotnet fsi aoc17.fsx | |
open System | |
open System.IO | |
open System.Collections.Generic | |
module Array2D = | |
let getRowCount (ary : 'a[,]) = ary.GetLength(0) | |
let getColumnCount (ary : 'a[,]) = ary.GetLength(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
// Advent of Code 2023. Day 16: The Floor Will Be Lava | |
// dotnet fsi aoc16.fsx | |
open System | |
open System.IO | |
type Dir = N | W | S | E | |
module Array2D = | |
let getRowCount (ary : 'a[,]) = ary.GetLength(0) |
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
// Advent of Code 2023. Day 15: Lens Library | |
// dotnet fsi aoc15.fsx | |
open System.IO | |
let readText fileName = | |
let text = File.ReadAllText fileName | |
text.TrimEnd() | |
let getHash s = |
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
// Advent of Code 2023. Day 15: Lens Library | |
// dotnet fsi aoc15.fsx | |
open System.IO | |
type Op = | |
| Insert of (string * int) | |
| Remove of string | |
let readText fileName = |
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
// Advent of Code 2023. Day 14: Parabolic Reflector Dish | |
// dotnet fsi aoc14.fsx | |
open System | |
open System.IO | |
module Array2D = | |
let getRowCount (ary : 'a[,]) = ary.GetLength(0) |
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
// Advent of Code 2023. Day 14: Parabolic Reflector Dish | |
// dotnet fsi aoc14.fsx | |
open System | |
open System.IO | |
let readLines = | |
File.ReadAllLines >> Array.filter ((<>) String.Empty) | |
let rollNorthStep (s1, s2) = |
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
// Advent of Code 2023. Day 13: Point of Incidence | |
// dotnet fsi aoc13.fsx | |
open System | |
open System.IO | |
let readChunks fileName = | |
let text = File.ReadAllText fileName | |
text.TrimEnd().Split("\n\n") |> Array.toList |
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
// Advent of Code 2023. Day 12: Hot Springs | |
// dotnet fsi aoc12.fsx | |
open System | |
open System.IO | |
let parseLine (s : string) = | |
let parts = s.Split(" ") | |
let springs = parts[0] | |
let damaged = parts[1] |