Another way to improve readability would be to set values of several bools and just writ them in your if statement.
Get in the habit of using white space too. Not sure why beginners are so reluctant to put spaces between variable and operators.Code:bool bGrid0 = grid[0][0] == 'x' && grid[0][1] == 'x'; bool bGrid1 = grid[1][0] == 'x' && grid[1][1] == 'x'; //etc. //then if(bGrid0 || bGrid1 || bGrid2) { //do stuff }




Reply With Quote