chore: change module
This commit is contained in:
parent
a0d852416f
commit
b97ecdc93c
|
@ -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)) }
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
aoc "go.sour.is/advent-of-code-2023"
|
||||
aoc "go.sour.is/advent-of-code"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)) }
|
||||
|
|
|
@ -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)) }
|
||||
|
|
|
@ -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...)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) }
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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} }
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module go.sour.is/advent-of-code-2023
|
||||
module go.sour.is/advent-of-code
|
||||
|
||||
go 1.21.4
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user