-1
How do I print a coordinate without printing multiple trays with the values I typed on the board?
tabuleiro = [[0 for x in range(0, 10)] for o in range(0, 10)]
print('------------------')
print(' a | b | c |')
print('0 ', tabuleiro[0][0], '|', tabuleiro[0][1], '|', tabuleiro[0][2], '|')
print('1 ', tabuleiro[1][0], '|', tabuleiro[1][1], '|', tabuleiro[1][2], '|')
print('2 ', tabuleiro[2][0], '|', tabuleiro[2][1], '|', tabuleiro[2][2], '|')
print('------------------')
while True:
coor = input('Informe sua coordenada: ')
if coor == 'a0':
tabuleiro[0][0] = coor
elif coor == 'b0':
tabuleiro[0][1] = coor
elif coor == 'c0':
tabuleiro[0][2] = coor
elif coor == 'a1':
tabuleiro[1][0] = coor
elif coor == 'b1':
tabuleiro[1][1] = coor
elif coor == 'c1':
tabuleiro[1][2] = coor
elif coor == 'a2':
tabuleiro[2][0] = coor
elif coor == 'b2':
tabuleiro[2][1] = coor
elif coor == 'c2':
tabuleiro[2][2] = coor
print('------------------')
print(' a | b | c |')
print('0 ', tabuleiro[0][0], '|', tabuleiro[0][1], '|', tabuleiro[0][2], '|')
print('1 ', tabuleiro[1][0], '|', tabuleiro[1][1], '|', tabuleiro[1][2], '|')
print('2 ', tabuleiro[2][0], '|', tabuleiro[2][1], '|', tabuleiro[2][2], '|')
print('------------------')
COMO ESTÁ SENDO IMPRIMIDO!
I wanted to leave the course flashing at each board position every time I make a move without having to print another board underneath!
– user217941