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)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.