I am trying to execute a for loop, this is the only part of the code which I cannot seem to figure out.
Code:
for(n=0;n<9;n++)
{
if(n == 0 || n == 2 || n == 4 || n == 6 || n == 7)
{
printf("Player X enter the letter of the space you want to occupy> ");
scanf("%c",¤tX);
player_X(currentX, board);
print_board(board);
}
else
{
printf("Player O enter the letter of the space you want to occupy> ");
scanf("%c",¤tO);
player_O(currentO, board);
print_board(board);
}
}
What happens is that "Player X" can enter the space he/she wants to occupy, then the loop runs thru again with n = 1 (which should make it execute the else part of the loop,) the printf runs fine but the scanf never executes, Any help is appreciated.