Piotr Czajkowski 1 vuosi sitten
vanhempi
commit
c75cc51f84
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      08/code.go

+ 2 - 1
08/code.go

@@ -83,9 +83,10 @@ func part(network Network, starts []string, goal string) int {
 			break
 		}
 
+		turn := network.moves[index]
 		for i := range starts {
 			d := network.paths[starts[i]]
-			if network.moves[index] == 'L' {
+			if turn == 'L' {
 				starts[i] = d.left
 			} else {
 				starts[i] = d.right