Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, dadonelson2109
If your accelerator suddenly gets stuck what should you do
Answers: 2
image
Computers and Technology, 22.06.2019 23:00, cchotshot
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
image
Computers and Technology, 23.06.2019 06:40, euniceyi56
How many nibbles can be stored in a 16-bit word?
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, daelinrobinson
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
Do you know the correct answer?
Write the function implementations for a program that plays the tic-tac-toe game on a 4×4 board. the...

Questions in other subjects:

Konu
Mathematics, 24.02.2021 01:00
Konu
Mathematics, 24.02.2021 01:00
Konu
Mathematics, 24.02.2021 01:00
Konu
Mathematics, 24.02.2021 01:00