#coding = utf-8

import random

def Creat_Card():
    card_type = ['♥','♠','♦','♣']
    card_values= ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
    n=1
    cards = ['大J','小J']
    for i in card_type:
        for j in card_values:
            cards.append((i+j))
            n += 1
    print('牌库生成中.............')
    print(cards.__len__())
    return cards


def WashAndPush_Card(cards):
    print('洗牌中.............')
    wash_card = random.shuffle(cards)   #shuffle可以直接将排序打乱
    print('发牌中')

    print('底 牌 : %s' %cards[0:3])

    player1 = cards[3:20]
    player2 = cards[20:37]
    player3 = cards[37:54]

    print ('player1 : '+ str(player1))
    print ('player2 : '+ str(player2))
    print ('player3 : '+ str(player3))



if __name__ == '__main__':
    WashAndPush_Card(Creat_Card())

  

相关文章:

  • 2021-11-17
  • 2021-09-15
  • 2022-12-23
  • 2018-11-03
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-11-08
  • 2021-10-16
  • 2022-01-21
  • 2022-01-29
相关资源
相似解决方案