Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#You need to debug and modify the program so that it is able to do random walking import random N = 1 0 FILLER =

#You need to debug and modify the program so that it is able to do random walking
import random
N =10
FILLER ='.'
#create a list to represent a row
#The row at first is filled with FILLER '.'
line =[]
for i in range(N):
line.append(FILLER)
#create a matrix
#The matrix is the maze to walk
a=[]
for i in range(N):
line = line[:]
a.append(line)
#always starts at the left top corner of the matrix
#fill the matrix cell at the left top corner 'A'
x =0
y =0
letter ='A'
a[x][y]= letter
#a sequence of random walk steps
#The below loop will settle the next letter
letter = chr(ord(letter)+1)
#The following loop broken due to
#running out of letters
while (letter <='Z'):
#find (x,y) for the current letter
#check the interative book chapter 5.4 random module for methods to use
#update the letter to present

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

What went well? What could have gone better?

Answered: 1 week ago

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago