Anonymous asked in Computers & InternetProgramming & Design · 6 days ago

computer science C programming assignment?

im new to programming, i have a tic tac toe assignment & im lost.first function was provided:

a) C function that allows the user to print a Tic-Tac-Toe board.

b) C function that allows the user to create a Tic-Tac-Toe board. In this case, the board is a 2D array of size 3x3, This allows the user to create a board and set some  X or O on the board at any cell. If user typed any invalid input(# not 1 - 9) or rather than entering X or O the user typed C the function should ignore his input and ask him to enter a valid input. 

c) C function that allows the user to check if a given Tic-Tac-Toe board is a valid board or an invalid board. The board is valid if it is an empty board or if the difference between the total number of X and the total number of O symbols on the board is 0 or 1.

d) C function that allows the user to find if any next move or next play for any

player X or O who has the turn to play is winning move. it will print the cell

number that if the player places an X or O in it they win the game. If there is more than one cell where the player could place his symbol in and win the game it should print all the winning cells for that player.

e) C function that finds which player (player X or O) has won the game (if any) use recursion to implement this function. If there is no winner the function should return 'D'  otherwise return the winner symbol, either 'X' or 'O' 

f) main function displays a menu for user and asks to select which

the function to be tested

4 Answers

Still have questions? Get your answers by asking now.