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

pull/11/head
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() {
@ -171,21 +172,27 @@ func (m *Path) next() bool {
}
}
if n == nil {
return false
return false
}
if n.value == 'S' {
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
}
@ -201,7 +207,7 @@ const (
ST int8 = iota
UP
DN
LF
LF
RT
)

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
@ -194,4 +194,4 @@ func all(m map[int]bool) []int {
return lis
}
func fromXY(x, y, w int) int { return y*w + x }
func toXY(i, w int) [2]int { return [2]int{i % w, i / w} }
func toXY(i, w int) [2]int { return [2]int{i % w, i / w} }

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
@ -107,7 +107,7 @@ func countPossible(s []rune, c []int) int {
for len(cstates) > 0 {
for st, num := range cstates {
si, ci, cc, expdot := st.springIndex, st.groupIndex, st.continuous, st.expectDot
// have we reached the end?
if si == len(s) {
if ci == len(c) {

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