I have a program I am writing that works on the principle of populating a two dimensional array to check the winning condition, it's noughts and crosses so the two dimensional array is populated on the click of a button, 1 for a circle, 2 for a cross, then the checkWin() will work on this principle, not the actual code...
if (myArray[0][0] == 1 && myArray[0][1] == 1 && myArray[0][2] == 1){
setBoolWinVal = true;
} else {
if(myArray[0][0] == 2 && myArray[0][1] == 2 && myArray[0][2] == 2){
setBoolWinVal = true;
}
you can see immediately that for every winning condition this will be messy, is there any way of rewriting this check for win to shorten it a little?