Update function playGame to do the following a. When prompting the players for their name i. Set the value for struct field playChar to the associated character for each player (i.e. X or O) Update the while loop condition to iterate eight times versus four Before calling function displayStats for each player, call function updateDiscCount for each player passing arguments Array board The player’s struct (i.e. playerX or playerO, as a pointer) After the end of the while loop, repeat the following function calls Call function displayBoard Call function updateDiscCount for each player Call function displayStats for each player

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I keep getting an "undefined symbol: _updateDiscCount" error.

This is what I am trying to achieve: 

Update function playGame to do the following
a. When prompting the players for their name

i. Set the value for struct field playChar to the associated character for each player (i.e. X or O)

  1. Update the while loop condition to iterate eight times versus four

  2. Before calling function displayStats for each player, call function

    updateDiscCount for each player passing arguments

    1. Array board

    2. The player’s struct (i.e. playerX or playerO, as a pointer)

  3. After the end of the while loop, repeat the following function

    calls

    1. Call function displayBoard

    2. Call function updateDiscCount for each player

    3. Call function displayStats for each player

 

This is the code having issues with: I cannot copy the entire code so I will add the part that is having issues. The "void updateDiscCount();" is my function prototype declared after the libraries

 

void updateDiscCount();

 

void playGame()

{

    // declare variable for each player as a struct

    struct Player playerX;

    struct Player playerO;

 

    // Othello board

    char board[ROW][COL]; // this is really a memory location of board[0][0]

    // black (X) always goes first

    int currentPlayer = PLAYER_X;

    int loop = ZERO;

 

    printf("Player X, please enter your name\n");

    scanf("%s", playerX.playerName);

    playerX.playChar = PLAYER_X;

    playerX.discCount = TWO;

 

    printf("Player O, please enter your name\n");

    scanf("%s", playerO.playerName);

    playerO.playChar = PLAYER_O;

    playerO.discCount = TWO;

 

    printf("%s and %s, let's play Othello!\n", playerX.playerName, playerO.playerName);

 

    // call function initializeBoard

    initializeBoard(board);

 

    while(loop < EIGHT)

    {

        // call function displayBoard

        displayBoard(board);

 

        // request the player's move

        if(currentPlayer == PLAYER_X)

        {

            makeMove(&playerX, board);

            currentPlayer = PLAYER_O;

        }

        else if(currentPlayer == PLAYER_O)

        {

            makeMove(&playerO, board);

            currentPlayer = PLAYER_X;

        }

        

        updateDiscCount(board, &playerX);

        updateDiscCount(board, &playerO);

        displayStats(playerX);

        displayStats(playerO);

 

        loop++;

        displayBoard(board);

        updateDiscCount(playerX);

        updateDiscCount(playerO);

        displayStats(playerO);

        displayStats(playerX);    

    }

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education