Skip to content

Commit 0513250

Browse files
authored
fix: birdwatcher template and document issues (#849)
* fix: error message for unimplemented function in the template * docs: fix the word `immutable` * docs: enhance the word `data-structure` * docs: fix the word `immutable` in concepts * docs: unify the line 7 among 3 different files
1 parent d2bee5b commit 0513250

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

concepts/for-loops/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Looping is a fundamental concept in programming that allows you to execute a blo
44
In Swift, there are two types of loops: [`for-in` loops][for-loops] and `while` loops.
55
In this chapter, you'll learn about `for-in` loops.
66

7-
For loops allows you to iterate over a sequence of values, taking each element in turn, and binding it to a variable of your choosing.
7+
For loops allows you to iterate over a sequence of values, taking each element in turn, binding it to a variable of your choosing.
88
Swift allows you to iterate over a variety of sequences, such as ranges, arrays, and strings (and more types which will be covered later).
99
When every element of the sequence has been iterated over, the loop exits.
1010

1111
For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
12-
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
12+
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
1313
Here's an example of a `for-in` loop that iterates over an array of numbers:
1414

1515
```swift

concepts/for-loops/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Swift allows you to iterate over a variety of sequences, such as ranges, arrays,
99
When every element of the sequence has been iterated over, the loop exits.
1010

1111
For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
12-
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
12+
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
1313
Here's an example of a `for-in` loop that iterates over an array of numbers:
1414

1515
```swift

exercises/concept/bird-watcher/.docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Swift allows you to iterate over a variety of sequences, such as ranges, arrays,
99
When every element of the sequence has been iterated over, the loop exits.
1010

1111
For loops are declared by using the `for` keyword, followed by a variable name, the `in` keyword, and a sequence of values to iterate over.
12-
The variable given in the `for-in` loop is inmutable, meaning you can't change its value inside the loop.
12+
The variable given in the `for-in` loop is immutable, meaning you can't change its value inside the loop.
1313
Here's an example of a `for-in` loop that iterates over an array of numbers:
1414

1515
```swift
@@ -46,7 +46,7 @@ number + 1
4646

4747
You can also iterate over a range of numbers using a `for-in` loop.
4848
This allows you to execute a block of code a specific number of times, for example, the range `1...5` will iterate over the numbers 1, 2, 3, 4, and 5, so the loop will execute 5 times.
49-
Sometimes you might want to iterate over indexes, in a datastructure like an array, then you can use a `0..<array.count` range.
49+
Sometimes you might want to iterate over indexes, in a data-structure like an array, then you can use a `0..<array.count` range.
5050

5151
```swift
5252
let numbers = [3, 10, 7, 11]

exercises/concept/bird-watcher/Sources/BirdWatcher/BirdWatcher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ func birdsInWeek(_ birdsPerDay: [Int], weekNumber: Int) -> Int {
77
}
88

99
func fixBirdCountLog(_ birdsPerDay: [Int]) -> [Int] {
10-
fatalError("Please implement the birdsInWeek(_:) function")
10+
fatalError("Please implement the fixBirdCountLog(_:) function")
1111
}

0 commit comments

Comments
 (0)