I just need some help to change my if statemtent to a loop because i'm making 15x15 board with 5 in a row wins and it would be tedious to use if statement. Heres the code with m attempt at the loop and the old loop for reference.
You want to iterate over a 15 x 15 array, but only check for 5 in a row?
I'm pretty sure you could implement that long condition for the if statement with a nested for loop. I'll leave this as the proverbial exercise for the reader, though. (Although, I might take the time to see if I can get it to work on my own as well.)
Perhaps you are trying to do too much all at once. It might be easier to break it down into simpler steps. For example, you might check each row for a win, then check each column. Perhaps something like this would work for checking rows:
This is pseudocode of course, and hasn't been fully tested, so use at your own discretion. Some modifications may be necessary. A similar set of for loops would be used to check columns instead of rows.