Browse Source

Dépot : Modif

master
vandepoele.e 2 years ago
parent
commit
be0c2e55c8
  1. 34
      bataille.py

34
bataille.py

@ -1,3 +1,6 @@
from random import *
from File import File_lst as File
class Carte:
def __init__(self, valeur, couleur):
self.valeur = valeur
@ -11,7 +14,32 @@ class Carte:
else:
return 0
class Jeux:
def __init__(self, paquet, nbcartes):
self.paquet = paquet
def __init__(self, nbcartes):
self.paquet = File()
if nbcartes == 32:
pq = [1, 7, 8, 9, 10, 'Valet', 'Dame', 'Roi']
else:
pq = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Valet', 'Dame', 'Roi']
for i in range(len(pq)):
rd = randint(0, len(pq)-1)
self.paquet.enfiler(pq[rd])
pq.pop(rd)
def distribue(self):
f1 = File()
f2 = File()
for i in range(self.paquet.taille()):
f1.enfiler(self.paquet[i])
class Joueur:
def __init__(self, paquet_j, nom):
self.paquet_j = paquet_j
self.nom = nom
def tire_carte(self):
self.derniere_carte = self.paquet_j.defiler()
return self.derniere_carte
Loading…
Cancel
Save