I'm making a program that Identifies if a blank tile exists or not. I already have a code in my 2d array which is
arr2 = [['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' 'E' 'A' '#' 'L' 'E' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' 'P' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' 'P' 'E' 'A' 'K' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' 'L' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' 'E' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0']]
I want to replace the # which is I labeled for the blank tile into one of the letters in the alphabet(A-Z). I already made a code that replaces the blank tile.
for i in arr2:
for j in i:
if j == '#':
i = [j.replace('#', 'A')]
But for some reason it is still a # not an A. How do I replace the #(blank tile) in the given array into an alphabet? Also, how do I make a pop-up message so that players can just type an alphabet to replace for the # which is the blank tile?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…