Skip to content
Snippets Groups Projects
Commit 7b4de1bc authored by Louis Chmielewski's avatar Louis Chmielewski
Browse files

play war.py

parent ed854b28
Branches
No related tags found
No related merge requests found
......@@ -108,9 +108,16 @@ def play(n_card: int, n_round: int) -> None:
n_card: le nombre de cartes à distribuer à chaque joueur.
n_round: le nombre maximal de tours
"""
...
m1, m2 = distribute(n_card)
pile = ApStack()
for i in range(n_round):
print(f"Tour {i + 1}")
if m1.is_empty() or m2.is_empty():
break
play_one_round(m1, m2, pile)
print("Partie terminée")
print(f"Joueur 1 : {len(m1)} cartes")
print(f"Joueur 2 : {len(m2)} cartes")
if __name__ == "__main__":
import apl1test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment