瀏覽代碼

Cosmetics

Piotr Czajkowski 1 年之前
父節點
當前提交
c75cc51f84
共有 1 個文件被更改,包括 2 次插入1 次删除
  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