diff --git a/S2/TP3/bataille_navale.py b/S2/TP3/bataille_navale.py index 02aa9e2..5d95ae3 100755 --- a/S2/TP3/bataille_navale.py +++ b/S2/TP3/bataille_navale.py @@ -68,6 +68,7 @@ def jouer(nom, descr): decrire_le_jeu(jeu) nbre_tirs = 0 while not tous_coules(jeu): + afficher_jeu(jeu) tir = lire_un_tir(nom) nbre_tirs += 1 nav, res = analyse_un_tir(jeu, tir) @@ -292,6 +293,17 @@ def decrire_le_jeu(jeu): print( 'À vous de jouer en répondant à l\'invite ?- par deux nombres séparés par une virgule.') +def afficher_jeu(jeu): + 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='') + else: + print('x', end='') + else: + print('.', end='') + print() def lire_un_tir(nom): """ diff --git a/auto.py b/auto.py index 5f1b43a..bcce435 100755 --- a/auto.py +++ b/auto.py @@ -92,4 +92,6 @@ def creerZip(semestre, tp): fichierZip.write(os.path.join(chem, f), os.path.join(nomDossier, f)) fichierZip.close() +os.link(chemin(semestreEnCours(), tpEnCours()), 't') +os.link(chemin(semestreEnCours()), 's') creerZip(semestreEnCours(), tpEnCours())