Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. if __name__ == '__main__':
  2.     analyser = analyser_commande()
  3.     if analyser.lister:
  4.         print(api.lister_parties(analyser.idul))
  5.     else:
  6.         afficher_damier_ascii(api.débuter_partie(analyser.idul)[1])
  7.         id_partie = api.débuter_partie(analyser.idul)[0]
  8.         pas_victoire = True
  9.         while pas_victoire:
  10.             type_coup = input("entrer le type de coup (D, MH ou MV)")
  11.             position = input("entrer la position sous forme de tuple")
  12.             choix_jeu = True
  13.             while choix_jeu:
  14.                 try:
  15.                     afficher_damier_ascii(api.jouer_coup(id_partie, type_coup, position))
  16.                     choix_jeu = False
  17.                 except StopIteration as fin:
  18.                     pas_victoire = False
  19.                     choix_jeu = False
  20.                     print(f'Victoire de {fin}')
  21.                 except RuntimeError as re:
  22.                     choix_jeu = False
  23.                     print(re)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement