Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wings Quest]: Fix casing #677

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exercises/concept/wings-quest/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ lose(powerUpActive: false, touchingEagle: true)

## 4. Define if bird wins

Define the `win(HasPickedUpAllSeeds:powerUpActive:touchingEagle:)` function that takes the arguments:
Define the `win(hasPickedUpAllSeeds:powerUpActive:touchingEagle:)` function that takes the arguments:

- `HasPickedUpAllSeeds` if the bird has picked up all of the seeds.
- `hasPickedUpAllSeeds` if the bird has picked up all of the seeds.
- `powerUpActive` if the bird has a power-up active.
- `touchingEagle` if the bird is an eagle.

The function should return `true` if the bird has gathered all of the seeds and has not lost based on the arguments defined in part 3, and return `false` otherwise.

```Swift
win(HasPickedUpAllSeeds: false, powerUpActive: true, touchingEagle: false)
win(hasPickedUpAllSeeds: false, powerUpActive: true, touchingEagle: false)
// Returns false
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ func lose(powerUpActive: Bool, touchingEagle: Bool) -> Bool {
return !powerUpActive && touchingEagle
}

func win(HasPickedUpAllSeeds: Bool, powerUpActive: Bool, touchingEagle: Bool) -> Bool {
return HasPickedUpAllSeeds && !lose(powerUpActive: powerUpActive, touchingEagle: touchingEagle)
func win(hasPickedUpAllSeeds: Bool, powerUpActive: Bool, touchingEagle: Bool) -> Bool {
return hasPickedUpAllSeeds && !lose(powerUpActive: powerUpActive, touchingEagle: touchingEagle)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ func lose(powerUpActive: Bool, touchingEagle: Bool) -> Bool {
fatalError("Please implement the lose(powerUpActive:touchingEagle:) function")
}

func win(HasPickedUpAllSeeds: Bool, powerUpActive: Bool, touchingEagle: Bool) -> Bool {
fatalError("Please implement the win(HasPickedUpAllSeeds:powerUpActive:touchingEagle:) function")
func win(hasPickedUpAllSeeds: Bool, powerUpActive: Bool, touchingEagle: Bool) -> Bool {
fatalError("Please implement the win(hasPickedUpAllSeeds:powerUpActive:touchingEagle:) function")
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ class TaskWin: XCTestCase {
func testWin() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertTrue(
win(HasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: false)
win(hasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: false)
)
}

func testDontWinIfLost() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertFalse(
win(HasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: true)
win(hasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: true)
)
}

func testWinIfPickedUpAllSeedsAndTouchingOtherBird() throws {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertFalse(
win(HasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: true)
win(hasPickedUpAllSeeds: true, powerUpActive: false, touchingEagle: true)
)
}
}