How do I check if there is an element in an array where both axes [X, Y]
match [drawx, drawy]
?
I have a NumPy array:
#format: [X, Y]
wallxy = numpy.array([[0,1],[3,2],[4,6]])
and two other variables:
#attached to a counter that increases value each loop
drawx = 3
drawy = 2
I'm using the array as a set of positions [[0,1],[3,2],[4,6]]
and I need to test if [drawx, drawy]
(also representing a position) is in one of the positions on both the X and Y axis etc. drawx = 4
drawy = 6
returns true drawx = 3
drawy = 2
returns true drawx = 4
drawy = 2
returns false drawx = 2
drawy = 1
returns false