Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

part 3 please consider parts 1 and 2 please provide the modified version of my code that would pass the test cases shown in part

part 3 please consider parts 1 and 2

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

please provide the modified version of my code that would pass the test cases shown in part 1 and which gives the expected output based on the description both provided above please don't give samples or stuff that seem similar cause I get so confused when adding it to my code as this has happened most of the times I asked questions and im running out of questions so please modify my code

Task 7 [[True, True, True], [True, True, True], [True, True, True] ] [[True, False, True], [True, True, True], [True, True, True]] (1,4) (10,12) In the Board class, define a method reaching_empty_matrix(self) that returns a matrix (list of lists) of Booleans of the same size as the board. An element of this matrix is True if the corresponding point on the board is either empty or reaches empty and False otherwise. The method must not modify the board. Task 8 In the Board class, define a method is_legal(self) that returns True if the position on the board is legal and False otherwise (see Background Information for the definition of a legal position). he rules of the game 1. Go is played on a 1919 square grid of points, by two players called Black and White. 2. Each point on the grid may be coloured black, white or empty. 3. A point P, not coloured C, is said to reach C, if there is a path of (vertically or horizontally) adjacent points of P 's colour from P to a point of colour C. 4. Clearing a colour is the process of emptying all points of that colour that don't reach empty. 5. Starting with an empty grid, the players alternate turns, starting with Black. 6. A turn is either a pass; or a move that doesn't repeat an earlier grid colouring. 7. A move consists of colouring an empty point one's own colour; then clearing the opponent colour, and then clearing one's own colour. 8. The game ends after two consecutive passes. 9. A player's score is the number of points of their colour, plus the number of empty points that reach only their colour. 10. The player with the higher score at the end of the game is the winner. Equal scores result in a tie. Task 7 [[True, True, True], [True, True, True], [True, True, True] ] [[True, False, True], [True, True, True], [True, True, True]] (1,4) (10,12) In the Board class, define a method reaching_empty_matrix(self) that returns a matrix (list of lists) of Booleans of the same size as the board. An element of this matrix is True if the corresponding point on the board is either empty or reaches empty and False otherwise. The method must not modify the board. Task 8 In the Board class, define a method is_legal(self) that returns True if the position on the board is legal and False otherwise (see Background Information for the definition of a legal position). he rules of the game 1. Go is played on a 1919 square grid of points, by two players called Black and White. 2. Each point on the grid may be coloured black, white or empty. 3. A point P, not coloured C, is said to reach C, if there is a path of (vertically or horizontally) adjacent points of P 's colour from P to a point of colour C. 4. Clearing a colour is the process of emptying all points of that colour that don't reach empty. 5. Starting with an empty grid, the players alternate turns, starting with Black. 6. A turn is either a pass; or a move that doesn't repeat an earlier grid colouring. 7. A move consists of colouring an empty point one's own colour; then clearing the opponent colour, and then clearing one's own colour. 8. The game ends after two consecutive passes. 9. A player's score is the number of points of their colour, plus the number of empty points that reach only their colour. 10. The player with the higher score at the end of the game is the winner. Equal scores result in a tie

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

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

What is the role of the Joint Commission in health care?

Answered: 1 week ago