Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I figured the first function pretty well but it is getting tough at the second function HELP ME PLS Homework Task 4_201903.pdf 1/1 numbers in

I figured the first function pretty well but it is getting tough at the second function

HELP ME PLS image text in transcribed

Homework Task 4_201903.pdf 1/1 numbers in a row, column or diagonal on their card. The player will then call, "Bingo!" 70 x 45 x x and the host will examine their card and award them the win. The numbers on the 7 | 22| 20 | | card range from 1 to 75. The center square on the grid is considered automatically crossed off. Write two functions: A function called generate_grid that returns a 5x5 list where each position is a random number between 1 and 75 and the center square (5 marks) marked with an 'X'. A function called grid_wins that takes a parameter called grid. It should return True if all positions in one row, column or diagonal contain only 'X's. (5 marks) Write a program to: Generate a grid using the generate_grid function. Loop the following until the grid_wins function returns True: (1 mark) (1 mark) Generate a random number between 1 and 75 and print it. If the grid contains that number, replace that number with an 'X'. Print the grid with one row per line. Check if the grid has crossed off a row, column or diagonal using the grid_wins function and print "Bingo!" if the function returns True. (1 mark) (4 marks) (2 marks) (1 mark) Ensure you include: A comment containing the academic integrity statement found on the Moodle. Comments throughout your code to explain important sections. Hint: Your initial bingo card should contain random numbers and may look like the following: [73,70,16,35,60,] (17,7,36,69,2,1 [22,13,x,69,6,] [74,22,31,61,3,] [64,44,47,48,53,] Throughout the program you should generate a random number and cross off that number if it was found, such as: Number was 73 (X,70,16,35,60,] (17,7,36,69,2,1 [22,13,x,69,6,] [74,22,31,61,3,1 [64,44,47,48,53,] Your program should end if all numbers in a column, row or diagonal become 'X', such as: [,, , 35,60,] [, , 36,,,] [,, , ,, 1 174,,31,,, ] [,, ,48,,]

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_2

Step: 3

blur-text-image_3

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago