i have this function:
void Win_Event(int player, int x, int y, int mat[][MAX]) {
int choice, i, j;
for (i = 0; i < y; i++) {
for (j = 0; j < x; j++) {
printf("\033[1;31m");
if (mat[i][j] == -1)
printf("\033[0;32m");
else if (mat[i][j] == 0)
printf("\033[0;35m");
printf("%3d |", mat[i][j]);
}
printf("\n");
}
printf("\033[1;31m");
printf("\n\033[0;36mPlayer %d Won!\nWould you like to replay? (1 -> yes, 2-> no):", player);
scanf_s("%d", &choice);
main(choice);
}
it basically checks if the player won then asks him if he wants to replay the game and sends that input back to the main function. the main function looks like this:
void main(int choice) {
printf("\033[0;33m");
printf("---Welcome To Pente---\n");
if (choice == 1)
SetBoardSize();
else
return 0;
}
the program just ignored the choice parameter completely and runs the SetBoardSize function straight away is there something i am missing?