Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os
- os.system('clear')
- class Domino:
- def __init__(self, a, b):
- self.a = a
- self.b = b
- def affichepoints(self):
- print(self.a + '\n' + self.b)
- def valeur(self):
- return self.a + self.b
- def __repr__(self):
- return(str(self.a) + '-' + str(self.b))
- def initialiser():
- dominos = [Domino(0, 0)]
- for i in range(1, 7):
- for x in range(i+1):
- dominos.append(Domino(x, i))
- return dominos
- def distribuer(dominos):
- used = []
- players = []
- for _ in range(4):
- player = []
- for j in range(7):
- while 1:
- index = random.randint(0, len(dominos)-1)
- if index not in used:
- break
- used.append(index)
- player.append(dominos[index])
- players.append(player)
- return players
- def game():
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement