subject

Write the function implementations for a program that plays the tic-tac-toe game on a 4×4 board. the winner is determined by 4 consecutive marks of the same kind. player x goes first, and player o goes second. the struct struct tictactoeboard { int curr_player ; int points [4*4]; }; encodes the state of the game. curr_player==1 means it’s x’s turn to play. curr_player==-1 means it’s o’s turn to play. points[4*4] contains the moves made so far. an empty point has value 0, a point marked x has value 1, and a point marked o has value -1. the procedure void printboard ( tictactoeboard board ); prints the board. the definition of printboard is provided, and it will clarify the meaning of tictactoeboard. the procedure void initboard ( tictactoeboard & board ); initializes the board. since x goes first, initboard must set board. curr_player to 1. since the board is empty at the beginning of the game, initboard must set all values of the array board. points to 0. the predicate bool isempty ( tictactoeboard board , int x , int y ); checks if the point (x, y) is empty and therefore available to play. the procedure void mark ( tictactoeboard & board , int x , int y

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
What percentage of companies is projected to use social media to locate new employees in 2012
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
Answers: 1
You know the right answer?
Write the function implementations for a program that plays the tic-tac-toe game on a 4×4 board. the...
Questions
question
Social Studies, 05.02.2020 01:59
question
Health, 05.02.2020 01:59
question
Spanish, 05.02.2020 01:59
Questions on the website: 13722362