Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Basics Swift Operators Working With Operators: Part 2

How to use comparison operator to find who has won or not

I am having trouble understanding what the questions is asking. I am not sure exactly what it means by what I should compare the operator to. Should I use the previous code from the previous task?

1 Answer

Corey F
PLUS
Corey F
Courses Plus Student 6,450 Points

The first part of the challenge is used in the second part of the challenge.

"Declare a constant named isWinner and assign the results of a comparison operation to check whether the player has won or not. If the total score is not 10, then the player has won"

So follow the directions

declare a constant named isWinner

<p>var initialScore = 8
let totalScore = ++initialScore
let isWinner = ______</p>

"If the total score is not 10, then the player has won"

<p>totalScore != 10</p>

"assign the results of a comparison operation to check whether the player has won or not."