Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started