Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let somePoint = (1, 0)
- switch somePoint {
- case (0,0):
- print("origin") // does not print
- fallthrough
- case (_, 0):
- print("y-axis") // prints y-axis. this makes sense
- fallthrough
- case(0, _):
- print("x-axis") // prints x-axis (because of fallthrough? this should not print)
- fallthrough
- case(-2...2, -2...2):
- print("in 5x5 box about the origin") // this prints and makes sense
- default:
- print("somewhere else") // does not print
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement