Question: #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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!