Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago