 # Bronze Challange

Hello everyone.
I’m having a hard time understanding some of the Bronze Challange at the end of Chapter 5.
So this is the code:
let point = (x: 1, y: 4)
switch point {
case let q1 where (point.x > 0) && (point.y > 0):
** print("(q1) is in quadrant 1")**

case let q2 where (point.x < 0) && (point.y > 0):
** print("(q2) is in quadrant 2")**

case let q3 where (point.x < 0) && (point.y < 0):
** print("(q3) is in quadrant 3")**

case let q4 where (point.x > 0) && (point.y < 0):
** print("(q4) is in quadrant 4")**

case (_, 0):
** print("(point) sits on thje x-axis")**

case (0, _):
** print("(point) sits on the y-axis")**

default:
** print(“case not covered.”)**
}

I don’t understand the purpose of the
case (_, 0):
print("(point) sits on thje x-axis")

case (0, _):
print("(point) sits on the y-axis")

default:
print(“case not covered.”)

I would highly appreciate it if someone explains what’s happening here. I understand that only q1 is true and the others are false, but what’s happening after that?
Thank you so much!

Those two cases look cryptic, but they are easy to understand. The following code does the same thing:

``````case (let x, let y) where y == 0:
print ("(point) sits on the x-axis")

case (let x, let y) where x == 0:
print ("(point) sits on the y-axis")
``````

Try also running the code with different points:

``````import Foundation

typealias Point = (x:Int, y:Int)

func inspect (point:Point) {
switch point {
case let q1 where (point.x > 0) && (point.y > 0):
print("(q1) is in quadrant 1")

case let q2 where (point.x < 0) && (point.y > 0):
print ("(q2) is in quadrant 2")

case let q3 where (point.x < 0) && (point.y < 0):
print ("(q3) is in quadrant 3")

case let q4 where (point.x > 0) && (point.y < 0):
print ("(q4) is in quadrant 4")

case (_, 0):
print ("(point) sits on the x-axis")

case (0, _):
print ("(point) sits on the y-axis")

default:
print ("case not covered.")
}
}

let points = [Point (x:0, y:0), Point (x:1, y:0), Point (x:0, y:3)]

for x in points {
inspect (point:x)
}
``````