From 68f008c7ffe3003af826cf9501360d50889e8612 Mon Sep 17 00:00:00 2001 From: Karl Spickermann Date: Tue, 20 Dec 2022 02:11:26 +0100 Subject: [PATCH] Day19 Part1 --- day19/day19.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/day19/day19.go b/day19/day19.go index 8e539fa..24ee665 100644 --- a/day19/day19.go +++ b/day19/day19.go @@ -26,12 +26,14 @@ func main() { highestGeode := make([]int, len(lines)) for i, line := range lines { blueprint := getBluePrint(line) - //fastestTime := getFastestTimeToElementN(blueprint, map[[4]int]State{[4]int{0, 0, 0, 0, 1, 0, 0, 0}: State{[4]int{0, 0, 0, 0}, [4]int{1, 0, 0, 0}, 0}}, 3) - //startStates := getAllPossibleCombinationsWithFastestTime(blueprint, map[[4]int]State{[4]int{0, 0, 0, 0, 1, 0, 0, 0}: State{[4]int{0, 0, 0, 0}, [4]int{1, 0, 0, 0}, 0}}, 3, fastestTime) - //tmpStates := getAllPossibleCombinationsWithFastestTime(blueprint, map[[4]int]State{[4]int{0, 0, 0, 0, 1, 0, 0, 0, 0}: State{[4]int{0, 0, 0, 0}, [4]int{1, 0, 0, 0}, 0}}, 2, fastestTime) - //fastestTime = getFastestTimeToElementN(blueprint, tmpStates, 3) - //startStates = getAllPossibleCombinationsWithFastestTime(blueprint, startStates, 3, fastestTime) - highestGeode[i] = getHighestGeode(blueprint, map[[4]int]State{[4]int{0, 0, 0, 0}: State{[4]int{0, 0, 0, 0}, [4]int{1, 0, 0, 0}, 0}}) + highestGeodeLine := 0 + for j := 0; j < 50; j++ { + tmphighestGeode := getHighestGeode(blueprint, map[[4]int]State{[4]int{0, 0, 0, 0}: State{[4]int{0, 0, 0, 0}, [4]int{1, 0, 0, 0}, 0}}) + if tmphighestGeode > highestGeodeLine { + highestGeodeLine = tmphighestGeode + } + } + highestGeode[i] = highestGeodeLine fmt.Println(highestGeode[i]) } sum := 0