TP3 afficher_jeu Plus performant
This commit is contained in:
parent
01489692ad
commit
bd2f00543a
|
@ -301,16 +301,18 @@ def afficher_jeu(jeu):
|
|||
"""
|
||||
if jeu['plateau']['larg'] > 30:
|
||||
return
|
||||
s = ''
|
||||
for x in range(1, jeu['plateau']['larg']+1):
|
||||
for y in range(1, jeu['plateau']['haut']+1):
|
||||
if (x, y) in jeu['coups_joues']:
|
||||
if (x, y) in jeu['plateau']:
|
||||
print('o', end=' ')
|
||||
s += 'o '
|
||||
else:
|
||||
print('x', end=' ')
|
||||
s += 'x '
|
||||
else:
|
||||
print('.', end=' ')
|
||||
print()
|
||||
s += '. '
|
||||
s += '\n'
|
||||
print(s)
|
||||
|
||||
def lire_un_tir(nom):
|
||||
"""
|
||||
|
|
Reference in a new issue