Hi im writing a simple tic tac toe program, im pretty new to c# and am struggling with my curly brackets. Ive got the code for my computer move function but am having problems putting the curly brackets in the right place for my loops. Ive now taken all the brackets out and am gonna start again. Any help or suggestions would be appreciated Thanks This is my code: int x = 0; int y = 0; for (x = 0; x < 2; x++) for (y = 0; y < 2; y++) if (matrix[x, y] == " ") break; if (matrix[x, y] == " ") break; if ((x * y) > 4) done = "d"; else matrix[x, y] = "o";
} } //End for(y) loop } //End for(x) loop I'm not sure what this code is supposed to do as I can't see the declaration of whole funciton/method and the variable/object 'done'. But I'll take a guess where your brackets should be above. Also what are you using as a code editor? VisualStudio will highlight the matching curly brace when editing so that you can see which ending brace matches the current opening brace when you are going through your code. Try moving the cursor to an opening brace, it should turn bold as well as the matching closing brace. - Ben