mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 12:45:10 +02:00
resolve some TODOs
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
// TODO: pull combinations, multiplying a slice of ints, into algos and mathy packages?
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
+1
-2
@@ -47,8 +47,7 @@ func spinlock(input string, part int) int {
|
|||||||
}
|
}
|
||||||
current = current.next
|
current = current.next
|
||||||
|
|
||||||
// progress log for part 2 brute force...
|
// progress log for part 2 brute force... this is SLOW
|
||||||
// todo optimize this slow pos
|
|
||||||
if i%1000000 == 0 {
|
if i%1000000 == 0 {
|
||||||
log.Println(i, "steps done")
|
log.Println(i, "steps done")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ func (graph *Graph) dfsMinmumDistance() int {
|
|||||||
// helper function to generate a cache string key
|
// helper function to generate a cache string key
|
||||||
// cache string is of the form entryKey:allKeysToFind
|
// cache string is of the form entryKey:allKeysToFind
|
||||||
func makeCacheKey(entry string, keysFound map[string]bool, totalKeys int) string {
|
func makeCacheKey(entry string, keysFound map[string]bool, totalKeys int) string {
|
||||||
// TODO: move this into the graph? to avoid making it 910238190382 times
|
|
||||||
allKeys := make([]string, totalKeys)
|
allKeys := make([]string, totalKeys)
|
||||||
for i := 0; i < totalKeys; i++ {
|
for i := 0; i < totalKeys; i++ {
|
||||||
allKeys[i] = cast.ASCIIIntToChar(int('a') + i)
|
allKeys[i] = cast.ASCIIIntToChar(int('a') + i)
|
||||||
|
|||||||
Reference in New Issue
Block a user