Problem:
The source file tictactoe2.c contains a call to a function named isValidMove() within the main function. However, this function is never defined or declared within the tictactoe2.c. While a function with this name exists in tictactoe.c, the lack of a local definition in this specific file results in an "undefined reference" linker error during the build process.
Proposed Solution:
- Define isValidMove function within the
tictactoe2.c
- Implement boundary checking to ensure the input integer is between 1 and 9.
- Add a check to verify if corressponding board[row][col] is currently an empty space (' ')
- Update the turn-switching logic so that the player variable only toggles when a valid move is successfully completed.
Problem:
The source file tictactoe2.c contains a call to a function named isValidMove() within the main function. However, this function is never defined or declared within the tictactoe2.c. While a function with this name exists in tictactoe.c, the lack of a local definition in this specific file results in an "undefined reference" linker error during the build process.
Proposed Solution:
tictactoe2.c