subject

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).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
1. which of the following is a search engine? a) mozilla firefox b)internet explorer c)google d)safari 2. which of the following statements is true? a) all search engines will provide the same results when you enter the same query. b) all search engines use the same amount of advertisements. c) some search engines are also browsers. d) search engines often provide different results, even when you enter the same query.
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
The idea that, for each pair of devices v and w, there’s a strict dichotomy between being “in range” or “out of range” is a simplified abstraction. more accurately, there’s a power decay function f (·) that specifies, for a pair of devices at distance δ, the signal strength f(δ) that they’ll be able to achieve on their wireless connection. (we’ll assume that f (δ) decreases with increasing δ.) we might want to build this into our notion of back-up sets as follows: among the k devices in the back-up set of v, there should be at least one that can be reached with very high signal strength, at least one other that can be reached with moderately high signal strength, and so forth. more concretely, we have values p1 ≥ p2 ≥ . . ≥ pk, so that if the back-up set for v consists of devices at distances d1≤d2≤≤dk,thenweshouldhavef(dj)≥pj foreachj. give an algorithm that determines whether it is possible to choose a back-up set for each device subject to this more detailed condition, still requiring that no device should appear in the back-up set of more than b other devices. again, the algorithm should output the back-up sets themselves, provided they can be found.\
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
You know the right answer?
Need with this c++ program.

use the following multi-dimension array declaration in mai...
Questions
question
Mathematics, 25.01.2021 17:30
question
Spanish, 25.01.2021 17:30
question
History, 25.01.2021 17:30
question
Chemistry, 25.01.2021 17:30
Questions on the website: 13722367