瀏覽代碼

Improvement

Piotr Czajkowski 2 年之前
父節點
當前提交
64bfc8893c
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      06/code.go

+ 3 - 3
06/code.go

@@ -32,8 +32,8 @@ func readInput(file string) []int {
 	return input
 }
 
-func part1(fish []int) int {
-	for d := 0; d < 80; d++ {
+func part1(fish []int, days int) int {
+	for d := 0; d < days; d++ {
 		max := len(fish)
 		for i := 0; i < max; i++ {
 			fish[i]--
@@ -53,5 +53,5 @@ func main() {
 	}
 
 	input := readInput(os.Args[1])
-	fmt.Println("Part 1:", part1(input))
+	fmt.Println("Part 1:", part1(input, 80))
 }