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() {
|
||||
|
@ -178,14 +179,20 @@ func (m *Path) next() bool {
|
|||
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
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
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