Computers and Technology

Need with this c++ program.

use the following multi-dimension array declaration in main() to create the simplifiedtwo player tic-tac-toe game (see notes below for important game variation)

int ttt[3][3] = { { 0,0,0 }, { 0,0,0 }, { 0,0,0 } }; //int ttt[3][3] = { 0 }; alternate way to code this!

your program should implement and use the following functions –

void render(int arr[3][3]);

displays the current state of the tic-tac-toe game in simple grid form.

void currentmove(int arr[3][3], int row, int col, int value);

updates the array with a value at the given row and col position(presumably 1 or 2). no validation is required (i. e. existing moves can beoverwritten).

int checkwin(int arr[3][3]); returns the winner as an int (i. e. 1, 2, or 0 if there is no winner yet)

or if you prefer (or another arrangement that can determine the winner) - bool checkplayer1(int arr[3][3]); bool checkplayer2(int arr[3][3]);

returns true if respective player wins, false if not. this maybe a little easier to program and implement than checkwin.

notes: main() should prompt players 1 and 2 to input column and row values (and renderthe results) until a winner is detected. a major change from traditional tic-tac-toe rules isthat there is no validation or prohibition against a player selecting a cell alreadyselected. the program simply keeps track of moves (and renders them), and checks for awinner (with no move validation). you of course are welcome to validate moves if youlike (but this raises the additional issue of determining when a ‘cats’ game occurs which is beyond the required scope of this project).

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, JeroMii
Think about a recent customer service experience - either positive or negative. write a brief summary of that experience. now think about those four characteristics we look for in customer service representatives. how did the representative in your example stack up? write down your answer and give specific examples.
Answers: 1
image
Computers and Technology, 22.06.2019 13:00, ajayfurlow
Which option should u select to ignore all tracked changes in a document
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
Do you know the correct answer?
Need with this c++ program.

use the following multi-dimension array declaration in mai...

Questions in other subjects:

Konu
Mathematics, 29.07.2019 00:00
Konu
Mathematics, 29.07.2019 00:00