Skip to content

Commit

Permalink
runtime input
Browse files Browse the repository at this point in the history
  • Loading branch information
dbut2 committed Dec 9, 2024
1 parent 6d55b58 commit 3c48733
Show file tree
Hide file tree
Showing 19 changed files with 92 additions and 109 deletions.
6 changes: 1 addition & 5 deletions 2024/01/01.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand All @@ -26,9 +25,6 @@ func solve(input [][]int) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/01/02.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
)

Expand All @@ -26,10 +24,7 @@ func solve(input [][]int) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 31)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/02/01.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/math"
)
Expand Down Expand Up @@ -35,10 +33,7 @@ func solve(input [][]int) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 2)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/02/02.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand Down Expand Up @@ -39,10 +38,7 @@ func isSafe(ints []int) bool {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 4)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/03/01.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"regexp"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand All @@ -21,10 +20,7 @@ func solve(input string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 161)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/03/02.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"regexp"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand Down Expand Up @@ -31,10 +30,7 @@ func solve(input string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(2, 48)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/04/01.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand Down Expand Up @@ -32,9 +31,6 @@ func solve(input space.Grid[byte]) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/04/02.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/space"
)
Expand Down Expand Up @@ -38,9 +36,6 @@ func rotate(dirs []space.Direction) []space.Direction {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/05/01.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"
"strings"

Expand Down Expand Up @@ -49,10 +48,7 @@ func solve(input [2][]string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 143)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/05/02.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"
"strings"

Expand Down Expand Up @@ -95,10 +94,7 @@ func solve(input [2][]string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 123)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/06/01.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/sets"
"github.com/dbut2/advent-of-code/pkg/space"
Expand Down Expand Up @@ -32,10 +30,7 @@ func solve(input space.Grid[byte]) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 41)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/06/02.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/sets"
"github.com/dbut2/advent-of-code/pkg/space"
Expand Down Expand Up @@ -53,10 +51,7 @@ func solve(input space.Grid[byte]) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 6)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/07/01.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
)

Expand All @@ -25,10 +23,7 @@ func calc(goal int, running int, nums []int) bool {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 3749)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/07/02.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/math"
)
Expand Down Expand Up @@ -39,10 +37,7 @@ func log10(a int) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 11387)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
11 changes: 2 additions & 9 deletions 2024/08/01.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"embed"
"time"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/sets"
Expand Down Expand Up @@ -36,15 +36,8 @@ func solve(input space.Grid[byte]) int {
return len(antinodes)
}

func diff(a, b space.Cell) space.Direction {
return space.Direction{a[0] - b[0], a[1] - b[1]}
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 14)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 2 additions & 5 deletions 2024/08/02.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"embed"
"time"

"github.com/dbut2/advent-of-code/pkg/harness"
"github.com/dbut2/advent-of-code/pkg/sets"
Expand Down Expand Up @@ -43,11 +43,8 @@ func diff(a, b space.Cell) space.Direction {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 34)
h.Expect(2, 9)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
7 changes: 1 addition & 6 deletions 2024/09/01.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"embed"

"github.com/dbut2/advent-of-code/pkg/harness"
)

Expand Down Expand Up @@ -44,10 +42,7 @@ func solve(input string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 1928)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
6 changes: 1 addition & 5 deletions 2024/09/02.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"embed"
"slices"

"github.com/dbut2/advent-of-code/pkg/harness"
Expand Down Expand Up @@ -52,10 +51,7 @@ func solve(input string) int {
}

func main() {
h := harness.New(solve, inputs)
h := harness.New(solve)
h.Expect(1, 2858)
h.Run()
}

//go:embed *.txt
var inputs embed.FS
Loading

0 comments on commit 3c48733

Please sign in to comment.