I have a small list:
moveless = [0,11,30,31,20,21,22,23,24,25,26,27,28,29]
And, for example, an array like so (it will always come nested in a list like this, but there will often be tens/hundreds of thousands of them, and any number from -1 to 31 can be in any spot):
starting_board = [([[ 6, -1, -1, 11, 0, 11, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, 11, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, 1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, 2],
[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
[-1, -1, -1, 20, 31, -1, 25, -1, -1, -1]])]
And I need to determine if any of the elements of this array are not in moveless. So if it parsed it and got to 6, it could stop.
I feel like there must be a faster and more elegant/pythonic way to do this than just a couple for loops, but my checking through the numpy docs/elsewhere on this site hasn't revealed anything terribly useful.