Alice=[5, 4, 6, 0] Bob=[7, 3, 9, 1, 8, 2] for iterable in range(31): Alice2=[] Bob2=[] more=[] # Alice a plus de carte if len(Alice)>len(Bob): for k in range(len(Bob)): # Bob gagne if Bob[0]>Alice[0]: Bob2.append(Bob[0]) Bob2.append(Alice[0]) Bob.pop(0) Alice.pop(0) # Alice gagne else: Alice2.append(Alice[0]) Alice2.append(Bob[0]) Bob.pop(0) Alice.pop(0) # donner les cartes restantes for k in Alice: more.append(k) Alice=[] Bob=[] for k in more: Alice.append(k) for k in Alice2: Alice.append(k) for k in Bob2: Bob.append(k) # Bob a plus de carte else: for k in range(len(Alice)): # Bob gagne if Bob[0]>Alice[0]: Bob2.append(Bob[0]) Bob2.append(Alice[0]) Bob.pop(0) Alice.pop(0) # Alice gagne else: Alice2.append(Alice[0]) Alice2.append(Bob[0]) Bob.pop(0) Alice.pop(0) # donner les cartes restantes for k in Bob: more.append(k) Alice=[] Bob=[] for k in more: Bob.append(k) for k in Alice2: Alice.append(k) for k in Bob2: Bob.append(k) print("Cartes d'Alice après",iterable,"tours:",Alice) print("Cartes de Bob après",iterable,"tours:",Bob) if len(Alice) == 0: print("Bob a gagné!") break elif len(Bob) ==0: print("Alice a gagné!") break else: continue print("Fin")