Does anyone have an idea how to write the following code in a shortened form?
if self.atPoint(locationUser) == blueMarkArray[0] || self.atPoint(locationUser) == blueMarkArray[1] || self.atPoint(locationUser) == blueMarkArray[2] || self.atPoint(locationUser) == blueMarkArray[3] || self.atPoint(locationUser) == blueMarkArray[4] || self.atPoint(locationUser) == blueMarkArray[5] || self.atPoint(locationUser) == blueMarkArray[6]{
print("its here")
}
Furthermore, I don't want to commit myself to a fixed number of elements in the blueMarkArray
array. It should be as variable as possible, because for example it can contain 4 elements, but also 12 elements.
For each answer I am very grateful.
EDIT:
How can you access the found element if I want to write the following: someNode.position = elementOfMarkArray.position