Code:int main(void) { char game_board[NUM_ROWS][NUM_COLS] = {{'~', '~'}, {'~'}}; char game_board2[NUM_ROWS][NUM_COLS] = {{'~', '~'}, {'~'}}; char game_board3[NUM_ROWS][NUM_COLS] = {{'~', '~'}, {'~'}}; char game_board4[NUM_ROWS][NUM_COLS] = {{'~', '~'}, {'~'}}; char ship, target; int direction = 0,compc = 0, compr = 0,count = 1,count_miss = 0, count_hit = 0, end = 0, row = 10, col = 10, status = 0,rows = 10, cols = 10, option = 0,target_r = 0, target_c = 0, place = 0, int_check_shot = 0; //srand( (unsigned)time( NULL ) ); srand (time(NULL)); init_game_board (game_board, 10, 10); init_game_board (game_board2, 10, 10); init_game_board (game_board3, 10, 10); init_game_board (game_board4, 10, 10); FILE *outfile = NULL; outfile = fopen ("Battleship.log", "w"); do { welcome_screen(); system("pause"); system("cls"); menu(); if (menu == 1) { system("pause"); system("cls"); manually_place_ships(game_board, 'c'); print_game_board(game_board, 10, 10); system("pause"); system("cls"); manually_place_ships(game_board, 'b'); print_game_board(game_board, 10, 10); system("pause"); system("cls"); manually_place_ships(game_board, 'r'); print_game_board(game_board, 10, 10); system("pause"); system("cls"); manually_place_ships(game_board, 's'); print_game_board(game_board, 10, 10); system("pause"); system("cls"); manually_place_ships(game_board, 'd'); print_game_board(game_board, 10, 10); system("pause"); system("cls"); } else { while(place_ship(game_board, 5, col, row, direction, 'c') == 0); while(place_ship(game_board, 4, col, row, direction, 'b') == 0); while(place_ship(game_board, 3, col, row, direction, 'r') == 0); while(place_ship(game_board, 3, col, row, direction, 's') == 0); while(place_ship(game_board, 2, col, row, direction, 'd') == 0); } while(place_ship(game_board2, 5, col, row, direction, 'c') == 0); while(place_ship(game_board2, 4, col, row, direction, 'b') == 0); while(place_ship(game_board2, 3, col, row, direction, 'r') == 0); while(place_ship(game_board2, 3, col, row, direction, 's') == 0); while(place_ship(game_board2, 2, col, row, direction, 'd') == 0); do { system ("cls"); printf("*******************************************************\n"); printf("** ROUND %d **\n", count); printf("*******************************************************\n"); printf(" players turn\n"); print_game_board(game_board, 10, 10); printf(" Players Target Board\n"); print_game_board(game_board3, 10, 10); get_target (&target_r, &target_c); int_check_shot = check_shot(game_board2, target_r, target_c); if (int_check_shot == 0) { count_miss++; } else { count_hit++; } update_board(game_board3, int_check_shot, target_r, target_c); system ("pause"); system ("cls"); print_game_board(game_board3, 10, 10); end = is_winner(game_board); end = is_winner(game_board2); system ("pause"); system ("cls"); printf("*******************************************************\n"); printf("** ROUND %d **\n", count); printf("*******************************************************\n"); printf(" computers turn\n"); print_game_board(game_board4, 10, 10); // right a function that creats two numbers 0 9 // if * M compr = rand () % 9; compc = rand () % 9; // printf what cordintest it shot printf("Computer Target Coordinate (%d,%d)\n", compr, compc); int_check_shot = check_shot(game_board, compr, compc); update_board(game_board4, int_check_shot, compr, compc); system ("pause"); system ("cls"); print_game_board(game_board4, 10, 10); end = is_winner(game_board); end = is_winner(game_board2); system ("pause"); count++; }while (end == 0); }while (status == 1); { fprintf ("Battleship.log", "%d\n%d\n%d\n", count, count_hit, count_miss); } fclose ("Battleship.log"); return 0; }