Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do i create this mine sweeper program *author: your name here *date: *description: provide a brief description of your program *self assessment: a description

image text in transcribed

How do i create this mine sweeper program

*author: your name here *date: *description: provide a brief description of your program *self assessment: a description of the number *of points you believe you earned # _/l total Nicety printed mine field Game loop Userspecified field size Multiple mines Adjacency numbers Gamewin check/display import random "We will fix the size of the mine field at 5 for now. *Later, you will let the user specify the size field size = 5 #This list is for keeping track of where the mines really are a list element has a that means there is a mine there #if a list element has a number, it indicates how many mines are *next to it. The list is initially att zeros. real _ field = #This list is for keeping track of which locations the user *has uncovered. It is initially all ? shown field = [ #This puts a mine in a random location in the field list mine location = random. #Get input on where to search print( Which spot do you want to search (4)?') search_spot = int(input()) #Grab what should be uncovered from the real field *and put it on the shown field shown_fietd[search_spot] = *End the game if the user found a mine. if real _ field [search_spotl a mine! Game Over") #Disptay the currently uncovered part of the field. print (shown_field)

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago