chore: change module
Some checks failed
Go Bump / bump (push) Failing after 7s
Go Test / build (push) Successful in 33s

This commit is contained in:
xuu 2023-12-15 15:13:24 -07:00
parent a0d852416f
commit b97ecdc93c
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F
17 changed files with 38 additions and 36 deletions

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() { aoc.MustResult(aoc.Runner(run)) }

View File

@ -8,7 +8,7 @@ import (
"strconv"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() {

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strconv"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() { aoc.MustResult(aoc.Runner(run)) }
@ -56,7 +56,6 @@ func (tab symbolTab) scanSymbol(p partNumber) bool {
// 553079
// 84363105
type result struct {
valuePT1 int
valuePT2 int
@ -110,7 +109,7 @@ func run(scan *bufio.Scanner) (*result, error) {
return p.number
}
return 0
}, parts...,)
}, parts...)
sumGears := aoc.SumFunc(
func(s *symbol) int {

View File

@ -7,7 +7,7 @@ import (
"strconv"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
//go:embed input.txt

View File

@ -8,8 +8,7 @@ import (
"strconv"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() { aoc.MustResult(aoc.Runner(run)) }

View File

@ -5,7 +5,7 @@ import (
"fmt"
"sort"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() { aoc.MustResult(aoc.Runner(run)) }

View File

@ -6,7 +6,7 @@ import (
"os"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() {
@ -147,4 +147,3 @@ func (m nodeMap) SolvePT2(path []rune) uint64 {
}
return aoc.LCM(loops...)
}

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
func main() { aoc.MustResult(aoc.Runner(run)) }

View File

@ -5,7 +5,7 @@ import (
"fmt"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
// var log = aoc.Log
@ -113,7 +113,8 @@ func (m *Path) readLine(text string) {
}
func (m *Path) buildPath() int {
m.start()
for m.next() {}
for m.next() {
}
return (len(m.p) + 1) / 2
}
func (m *Path) start() {
@ -177,15 +178,21 @@ func (m *Path) next() bool {
last := n.whence
next := m.head.left.whence
switch last<<4|next {
case UP<<4|UP, DN<<4|DN: m.head.value = '|' // UP UP, DN DN
case LF<<4|LF, RT<<4|RT: m.head.value = '-' // LF LF, RT RT
switch last<<4 | next {
case UP<<4 | UP, DN<<4 | DN:
m.head.value = '|' // UP UP, DN DN
case LF<<4 | LF, RT<<4 | RT:
m.head.value = '-' // LF LF, RT RT
case UP<<4|RT, LF<<4|DN: m.head.value = 'J' // UP RT, LT DN
case UP<<4|LF, RT<<4|DN: m.head.value = 'L' // UP RT, RT DN
case UP<<4 | RT, LF<<4 | DN:
m.head.value = 'J' // UP RT, LT DN
case UP<<4 | LF, RT<<4 | DN:
m.head.value = 'L' // UP RT, RT DN
case DN<<4|RT, LF<<4|UP: m.head.value = '7' // DN LF, LF UP
case RT<<4|UP, DN<<4|LF: m.head.value = 'F' // DN LF, RT UP
case DN<<4 | RT, LF<<4 | UP:
m.head.value = '7' // DN LF, LF UP
case RT<<4 | UP, DN<<4 | LF:
m.head.value = 'F' // DN LF, RT UP
}
return false
@ -193,7 +200,6 @@ func (m *Path) next() bool {
m.add(n)
return true
}

View File

@ -7,7 +7,7 @@ import (
"sort"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
// var log = aoc.Log

View File

@ -7,7 +7,7 @@ import (
"slices"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
// var log = aoc.Log

View File

@ -7,7 +7,7 @@ import (
_ "embed"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
"github.com/matryer/is"
)

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
var log = aoc.Log

View File

@ -6,7 +6,7 @@ import (
"fmt"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
"golang.org/x/exp/maps"
)
@ -132,7 +132,6 @@ func reverse(m Map) Map {
}
return m
}
func cycle(m Map) (Map, [5]int) {
var current [5]int

View File

@ -7,7 +7,7 @@ import (
"slices"
"strings"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
var log = aoc.Log
@ -129,7 +129,7 @@ func (lis boxes) Sum() int {
var sum int
for b := range lis {
for s := range lis[b] {
sum += (b+1) * (s+1) * lis[b][s].value
sum += (b + 1) * (s + 1) * lis[b][s].value
}
}
return sum

2
go.mod
View File

@ -1,4 +1,4 @@
module go.sour.is/advent-of-code-2023
module go.sour.is/advent-of-code
go 1.21.4

View File

@ -5,7 +5,7 @@ import (
_ "embed"
"fmt"
aoc "go.sour.is/advent-of-code-2023"
aoc "go.sour.is/advent-of-code"
)
// var log = aoc.Log