Initial commit
This commit is contained in:
commit
69ab59a51d
8 changed files with 136 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
.bsp
|
||||||
|
.direnv
|
||||||
|
.metals
|
||||||
|
.scala-build
|
||||||
27
.scalafmt.conf
Normal file
27
.scalafmt.conf
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
version = "3.9.9"
|
||||||
|
runner.dialect = scala3
|
||||||
|
|
||||||
|
preset=defaultWithAlign
|
||||||
|
|
||||||
|
assumeStandardLibraryStripMargin = true
|
||||||
|
maxColumn = 100
|
||||||
|
continuationIndent.callSite = 2
|
||||||
|
continuationIndent.defnSite = 2
|
||||||
|
align.arrowEnumeratorGenerator = true
|
||||||
|
align.openParenDefnSite = false
|
||||||
|
align.stripMargin = true
|
||||||
|
rewrite.rules = [RedundantBraces, Imports, RedundantParens, SortModifiers, PreferCurlyFors]
|
||||||
|
rewrite.redundantBraces.ifElseExpressions = true
|
||||||
|
rewrite.redundantBraces.stringInterpolation = true
|
||||||
|
verticalMultiline.atDefnSite = true
|
||||||
|
verticalMultiline.newlineAfterOpenParen = true
|
||||||
|
optIn.breaksInsideChains = true
|
||||||
|
lineEndings = unix
|
||||||
|
|
||||||
|
rewrite.scala3.convertToNewSyntax = true
|
||||||
|
rewrite.scala3.removeOptionalBraces = yes
|
||||||
|
rewrite.scala3.insertEndMarkerMinLines = 30
|
||||||
|
rewrite.scala3.removeEndMarkerMaxLines = 29
|
||||||
|
newlines.topLevelStatementBlankLines = [
|
||||||
|
{ regex = "^Import", blanks { after = 1 } }
|
||||||
|
]
|
||||||
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1764506988,
|
||||||
|
"narHash": "sha256-clj4TsIVqiFfvyu+mfm3s94Y7iOP+eRa62wxzLUV49M=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "4c7d90a136071eb8154d6b3fe63b0046de9d4712",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
20
flake.nix
Normal file
20
flake.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ nixpkgs, flake-utils, ... }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShell = pkgs.mkShell {
|
||||||
|
buildInputs = [ pkgs.scala-cli ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
2
project.scala
Normal file
2
project.scala
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
//> using scala 3.7.4
|
||||||
|
//> using option -Wunused:all
|
||||||
7
src/aoc.scala
Normal file
7
src/aoc.scala
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
package aoc
|
||||||
|
|
||||||
|
import scala.io.Source
|
||||||
|
import scala.util.Using
|
||||||
|
|
||||||
|
def loadInput(dayNumber: String) =
|
||||||
|
Using.resource(Source.fromFile(s"input/day$dayNumber"))(_.mkString.trim)
|
||||||
14
src/day01.scala
Normal file
14
src/day01.scala
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
package aoc
|
||||||
|
package day01
|
||||||
|
|
||||||
|
val dayNumber = "01"
|
||||||
|
|
||||||
|
@main def part1: Unit =
|
||||||
|
println(part1(loadInput(dayNumber)))
|
||||||
|
|
||||||
|
@main def part2: Unit =
|
||||||
|
println(part2(loadInput(dayNumber)))
|
||||||
|
|
||||||
|
def part1(input: String): String = ""
|
||||||
|
|
||||||
|
def part2(input: String): String = ""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue