Computers and Technology

G each time after a player marks a space as either X or O to determined if there's a winner on the board. The method should return one of the GameBoardPlayer members (NONE, X, O, DRAW) to indicate the winner of the board. A player (either X or O) wins if they occupy all spaces in a row, in a column, or diagonal (but if the board is not a square, there's no need to check diagonal). If there's a no winner, and there's no more empty space on the board, this returns DRAW; if there's still empty space, it should return NONE. Hint: in __str__() and get_winner(), you should use only get(row, col) to inspect the values, not <2darray>[row][col]; also use only get_nrows() and get_ncols(). Then you can simply copy these two methods to BitGameBoard and use them there without modifications. This isn't actually the right approach, but is ok and the simplest until we learn inheritance. But if you know how to avoid the copy-and-paste, feel free to do it.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, Thisisdifinite
Which of the following would you find on a network
Answers: 3
image
Computers and Technology, 23.06.2019 19:30, alangonsales6232
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, reaganphelps3
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, stephanieanaya7
Why does the pc send out a broadcast arp prior
Answers: 1
Do you know the correct answer?
G each time after a player marks a space as either X or O to determined if there's a winner on the b...

Questions in other subjects: