#include <stdio.h>
#include <stdlib.h>
#include <time.h>
main(){
char cChoice;
printf("****************************************\n\n");
printf(" FLIP!-TAC-TOE 3D \n\n");
printf(" Enter S to start the game or \n\n");
printf(" E to exit! \n\n");
printf(" Choice: ", cChoice);
scanf("%c", &cChoice);
if(cChoice == 'S') function1 ();
else exit(EXIT_SUCCESS);
printf("\n****************************************\n\n");
system("CLS");
void function1(){
char cMarker1;
int i = 1;
char alpha[] = "abcdefghijklmnopqrstuvwxyzW";
while (1)
{
printf("**************** TURN %d ******************\n\n", i);
printf(" | | | | | | \n");
printf(" %c | %c | %c %c | %c | %c %c | %c | %c \n", alpha[0], alpha[1], alpha[2], alpha[9], alpha[10], alpha[11], alpha[17], alpha[18], alpha[19]);
printf(" ___| ___ |___ ___| ___ |___ ___| ___ |___ \n");
printf(" | | | | | | \n");
printf(" %c | %c | %c %c | %c | %c %c | %c | %c \n", alpha[3], alpha[4], alpha[5], alpha[12], alpha[26], alpha[13], alpha[20], alpha[21], alpha[22]);
printf(" ___| ___ |___ ___| ___ |___ ___| ___ |___ \n");
printf(" | | | | | | \n");
printf(" %c | %c | %c %c | %c | %c %c | %c | %c \n", alpha[6], alpha[7], alpha[8], alpha[14], alpha[15], alpha[16], alpha[23], alpha[24], alpha[25]);
printf(" | | | | | | \n\n");
printf("Where would you want to place your \nmarker? ");
scanf("%c", &cMarker1);
if( cMarker1 >= 'a' && cMarker1 <= 'z' ){
fflush(stdin);
alpha[cMarker1-'a'] = 'X';
printf("You chose to place your marker on \nblock %c\n", cMarker1);
}
else{
printf("Cannot place your marker at %c\n", cMarker1);
printf("********************************************\n");
i++;
}
*How can I call the function1 in the main? so that when the user inputs S it will start the game.. Can somebody reconstruct my code? Thank you very much!