Question: Using Pythong to make a Tic-tac-toe game in a 2D list where EMPTY = 0 X = 1 O = 2. I'm currently struggling with

Using Pythong to make a Tic-tac-toe game in a 2D list where

EMPTY = 0 X = 1 O = 2.

I'm currently struggling with Part 6

Part 6: Checking if a player has won We will now use your sub-functions to determine if a player has won the current board. In effect, the question of whether a player has won is equivalent to the question of if the player has a win in any row, a win in any column, or a win in any diagonal. Create a function named won . The function will take 2 parameters: 1. a two-dimensional list that holds a representation of the board game-state 2. the piece type of one of the playersThe function will return True if the player has a win in the board, or False if the player has not won. The following pseudo-code should help. Note, that the if-statements are asking a question we already created sub-functions to answer. Make use of your sub-functions in those locations. Your solution should be the same length as this pseudo-code when complete. /

For every row board If win in that row Return True For every column in board If win in that column Return True If win in diagonal Return true Otherwise return false

Thanks a lot for helping out!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!