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";

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";