day20, small cleanup

This commit is contained in:
efim
2023-12-20 13:26:34 +00:00
parent 98206fe6d4
commit 727099dbd9
3 changed files with 21 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ func FindSubGraphLoopLength(subgraph map[string]any, allModules map[string]Modul
seenSubgraphStates := make(map[string]int)
monitoredPulses = make(map[int][]PulseType)
for {
monitoredPulsesOfTheStep := PropagateButtonPressWithMonitor(allModules, step, monitorOutputsOf)
subgraphModules := make(map[string]Module)
for key, _ := range subgraph {
subgraphModules[key] = allModules[key]
@@ -53,7 +54,6 @@ func FindSubGraphLoopLength(subgraph map[string]any, allModules map[string]Modul
}
seenSubgraphStates[subgraphState] = step
monitoredPulsesOfTheStep := PropagateButtonPressWithMonitor(allModules, step, monitorOutputsOf)
if len(monitoredPulsesOfTheStep) > 0 {
monitoredPulses[step] = monitoredPulsesOfTheStep
}