diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bd13ffe..684aa6b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,13 +21,9 @@ jobs: uses: golangci/golangci-lint-action@v3 with: version: latest - working-directory: ./go - name: Build - working-directory: ./go run: go build -v ./... - name: Test - working-directory: ./go run: go test -v ./... - name: Benchmark - working-directory: ./go run: go test -bench=Benchmark -benchmem -v ./... diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..52d42b1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "qselle" + ] +} diff --git a/README.md b/README.md index 69af4ee..87eee65 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,21 @@ - - -[![Go](https://github.com/quentinselle/advent-of-code-2023/actions/workflows/go.yml/badge.svg)](https://github.com/quentinselle/advent-of-code-2023/actions/workflows/go.yml) [![wakatime](https://wakatime.com/badge/github/quentinselle/advent-of-code-2023.svg)](https://wakatime.com/badge/github/quentinselle/advent-of-code-2023) +[![Go](https://github.com/qselle/advent-of-code-2023/actions/workflows/go.yml/badge.svg)](https://github.com/qselle/advent-of-code-2023/actions/workflows/go.yml) [![wakatime](https://wakatime.com/badge/github/qselle/advent-of-code-2023.svg)](https://wakatime.com/badge/github/qselle/advent-of-code-2023) # Advent of code 2023 🎄🎅 Enter the competition: https://adventofcode.com/2023 + +## Build + +```console +advent-of-code-2023/day1 $> go build +advent-of-code-2023/day1 $> ./day1 +Part 1: 52974 +Part 2: 53340 +``` + +## Test + +```console +advent-of-code-2023/day1 $> go test +PASS +ok github.com/qselle/aoc/2023/day1 0.269s +``` diff --git a/go/day1/input.txt b/day1/input.txt similarity index 100% rename from go/day1/input.txt rename to day1/input.txt diff --git a/go/day1/main.go b/day1/main.go similarity index 97% rename from go/day1/main.go rename to day1/main.go index cc6b30b..4b2fc76 100644 --- a/go/day1/main.go +++ b/day1/main.go @@ -6,7 +6,7 @@ import ( "sync" "unicode" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) var ( diff --git a/go/day1/main_test.go b/day1/main_test.go similarity index 100% rename from go/day1/main_test.go rename to day1/main_test.go diff --git a/go/day10/input.txt b/day10/input.txt similarity index 100% rename from go/day10/input.txt rename to day10/input.txt diff --git a/go/day10/main.go b/day10/main.go similarity index 98% rename from go/day10/main.go rename to day10/main.go index 8e56653..8b44ae2 100644 --- a/go/day10/main.go +++ b/day10/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) const ( diff --git a/go/day10/main_test.go b/day10/main_test.go similarity index 100% rename from go/day10/main_test.go rename to day10/main_test.go diff --git a/go/day2/input.txt b/day2/input.txt similarity index 100% rename from go/day2/input.txt rename to day2/input.txt diff --git a/go/day2/main.go b/day2/main.go similarity index 97% rename from go/day2/main.go rename to day2/main.go index 2b12a42..36bc915 100644 --- a/go/day2/main.go +++ b/day2/main.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Set struct { diff --git a/go/day2/main_test.go b/day2/main_test.go similarity index 100% rename from go/day2/main_test.go rename to day2/main_test.go diff --git a/go/day3/input.txt b/day3/input.txt similarity index 100% rename from go/day3/input.txt rename to day3/input.txt diff --git a/go/day3/main.go b/day3/main.go similarity index 98% rename from go/day3/main.go rename to day3/main.go index 86c6bf1..bec9681 100644 --- a/go/day3/main.go +++ b/day3/main.go @@ -4,7 +4,7 @@ import ( "fmt" "unicode" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Coordinates struct { diff --git a/go/day3/main_test.go b/day3/main_test.go similarity index 100% rename from go/day3/main_test.go rename to day3/main_test.go diff --git a/go/day4/input.txt b/day4/input.txt similarity index 100% rename from go/day4/input.txt rename to day4/input.txt diff --git a/go/day4/main.go b/day4/main.go similarity index 97% rename from go/day4/main.go rename to day4/main.go index 800fe7f..7070057 100644 --- a/go/day4/main.go +++ b/day4/main.go @@ -5,7 +5,7 @@ import ( "slices" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type ScratchCard struct { diff --git a/go/day4/main_test.go b/day4/main_test.go similarity index 100% rename from go/day4/main_test.go rename to day4/main_test.go diff --git a/go/day5/input.txt b/day5/input.txt similarity index 100% rename from go/day5/input.txt rename to day5/input.txt diff --git a/go/day5/main.go b/day5/main.go similarity index 97% rename from go/day5/main.go rename to day5/main.go index ecf3320..44ce146 100644 --- a/go/day5/main.go +++ b/day5/main.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Rule struct { diff --git a/go/day5/main_test.go b/day5/main_test.go similarity index 100% rename from go/day5/main_test.go rename to day5/main_test.go diff --git a/go/day6/input.txt b/day6/input.txt similarity index 100% rename from go/day6/input.txt rename to day6/input.txt diff --git a/go/day6/main.go b/day6/main.go similarity index 96% rename from go/day6/main.go rename to day6/main.go index f6b5464..caa03e0 100644 --- a/go/day6/main.go +++ b/day6/main.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Race struct { diff --git a/go/day6/main_test.go b/day6/main_test.go similarity index 100% rename from go/day6/main_test.go rename to day6/main_test.go diff --git a/go/day7/input.txt b/day7/input.txt similarity index 100% rename from go/day7/input.txt rename to day7/input.txt diff --git a/go/day7/main.go b/day7/main.go similarity index 98% rename from go/day7/main.go rename to day7/main.go index 0f85a7c..23232aa 100644 --- a/go/day7/main.go +++ b/day7/main.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Type int diff --git a/go/day7/main_test.go b/day7/main_test.go similarity index 100% rename from go/day7/main_test.go rename to day7/main_test.go diff --git a/go/day8/input.txt b/day8/input.txt similarity index 100% rename from go/day8/input.txt rename to day8/input.txt diff --git a/go/day8/main.go b/day8/main.go similarity index 97% rename from go/day8/main.go rename to day8/main.go index 9926de6..338476b 100644 --- a/go/day8/main.go +++ b/day8/main.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Node struct { diff --git a/go/day8/main_test.go b/day8/main_test.go similarity index 100% rename from go/day8/main_test.go rename to day8/main_test.go diff --git a/go/day9/input.txt b/day9/input.txt similarity index 100% rename from go/day9/input.txt rename to day9/input.txt diff --git a/go/day9/main.go b/day9/main.go similarity index 97% rename from go/day9/main.go rename to day9/main.go index 996c444..e1d4d76 100644 --- a/go/day9/main.go +++ b/day9/main.go @@ -4,7 +4,7 @@ import ( "fmt" "slices" - "github.com/quentinselle/aoc/2023/go/utils" + "github.com/qselle/advent-of-code-2023/utils" ) type Sequence []int diff --git a/go/day9/main_test.go b/day9/main_test.go similarity index 100% rename from go/day9/main_test.go rename to day9/main_test.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1a08a70 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/qselle/advent-of-code-2023 + +go 1.23.3 diff --git a/go/README.md b/go/README.md deleted file mode 100644 index 96cf534..0000000 --- a/go/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Go - -## Build - -```console -advent-of-code-2023/day1 $> go build -advent-of-code-2023/day1 $> ./day1 -Part 1: 52974 -Part 2: 53340 -``` - -## Test - -```console -advent-of-code-2023/day1 $> go test -PASS -ok github.com/quentinselle/aoc/2023/day1 0.269s -``` diff --git a/go/go.mod b/go/go.mod deleted file mode 100644 index 867bed9..0000000 --- a/go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/quentinselle/aoc/2023/go - -go 1.22.1 diff --git a/rust/README.md b/rust/README.md deleted file mode 100644 index 04e3d8f..0000000 --- a/rust/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Rust - -## Build diff --git a/go/utils/utils.go b/utils/utils.go similarity index 100% rename from go/utils/utils.go rename to utils/utils.go