jeudecarte.py

Created by redgl0w

Created on August 26, 2020

470 Bytes

https://twitter.com/NumWorksFR/status/1298500424807440386


from random import *
types1 = ["as", "2", "3", "4", "5", "6", "7", "8", "9", "10", "valet", "dame", "roi"]
types2 = ["trefle", "pique", "carreau", "coeur"]
cartes = ["joker", "joker"]

for type1 in types1:
  for type2 in types2:
    cartes.append(type1 + " de " + type2)

# Shiffer yates algorithm
for i in range(len(cartes)-1, 0, -1): 
    j = randint(0, i + 1)  
    cartes[i], cartes[j] = cartes[j], cartes[i]  

for carte in cartes:
  print(carte)