# Question about Chapter 9 challenge

**URL:** <https://forums.kodeco.com/t/question-about-chapter-9-challenge/26867>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [March 3, 2017, 7:59pm UTC](https://forums.kodeco.com/t/question-about-chapter-9-challenge/26867 "2017-03-03T19:59:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudenik](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rudenik/32/81494_2.png) [@rudenik](https://forums.kodeco.com/u/rudenik)\
**Post date:** [March 3, 2017, 7:59pm UTC](https://forums.kodeco.com/t/question-about-chapter-9-challenge/26867/1 "2017-03-03T19:59:08Z")

</div>

I was wondering if someone could explain this line from Chapter 9 (Page 240) a little bit further.

> ```
> let labelNode = contact.bodyA.categoryBitMask ==
> PhysicsCategory.Label ? contact.bodyA.node :
> contact.bodyB.node
> 
> ```

I was able to complete the challenge first without the guidelines as suggested. I decided to take it one step further, and try it again with the suggested directions. I was able to implement it and complete the challenge, but was wondering if someone could offer a bit more detail about this.

Thanks.

---

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [March 4, 2017, 12:24am UTC](https://forums.kodeco.com/t/question-about-chapter-9-challenge/26867/2 "2017-03-04T00:24:50Z")

</div>

@rudenik - That’s a ternary operator.

```auto
let a = 1 == 2 ? 3 : 4

```

That is equivalent to:

```auto
let a: Int
if 1 == 2 {
  a = 3
} else {
  a = 4
}

```

So your code is the equivalent of:

```auto
let labelNode: SKNode
if contact.bodyA.categoryBitMask == PhysicsCategory.Label {
  labelNode = contact.bodyA.node
} else {
  labelNode = contact.bodyB.node
}

```

---

<div class="post-metadata">

**Author:** ![rudenik](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rudenik/32/81494_2.png) [@rudenik](https://forums.kodeco.com/u/rudenik)\
**Post date:** [March 4, 2017, 5:03pm UTC](https://forums.kodeco.com/t/question-about-chapter-9-challenge/26867/3 "2017-03-04T17:03:57Z")

</div>

Awesome explanation that you very much.
