double_array = [
["0", "0", "0", "0", "0"],
["0", "0", "0", "0", "0"],
["0", "0", "0", "0", "0"],
["0", "0", "0", "0", "0"],
["0", "0", "0", "0", "0"],
]
Let's say the digits in this array change like so:
double_array = [
["1", "0", "0", "0", "0"],
["0", "1", "0", "0", "0"],
["0", "0", "1", "0", "0"],
["0", "0", "0", "1", "0"],
["0", "0", "0", "0", "0"],
]
How would I get be able to detect on that with some kind of if statement? Something like if there are four in a row diagonally do [insert action here].
The same goes for if it were vertically or horizontally like so:
double_array = [
["1", "0", "0", "0", "0"],
["1", "0", "0", "0", "0"],
["1", "0", "0", "0", "0"],
["1", "0", "0", "0", "0"],
["0", "1", "1", "1", "1"],
]
I'd prefer the least complex way possible.