|
#-*- coding: UTF-8 -*-
import random
def Game(self, palyer, all_poker):
all_pokers = all_poker
all_pokers = ['big_king', 'small_king', 'flower_2', 'flower_3', 'flower_4', 'flower_5', 'flower_6', 'flower_7',
'flower_8', 'flower_9', 'flower_10', 'flower_J', 'flower_Q', 'flower_K', 'flower_A', 'square_2',
'square_3', 'square_4', 'square_5', 'square_6', 'square_7', 'square_8', 'square_9', 'square_10',
'square_J', 'square_Q', 'square_K', 'square_A', 'black_2', 'black_3', 'black_4', 'black_5', 'black_6',
'black_7', 'black_8', 'black_9', 'black_10', 'black_J', 'black_Q', 'black_K', 'black_A', 'red_2',
'red_3', 'red_4', 'red_5', 'red_6', 'red_7', 'red_8', 'red_9', 'red_10', 'red_J', 'red_Q', 'red_K',
'red_A']
player = random.sample(all_pokers,17)
usera = dict[player]
if len(usera) > 0:
all_pokers = all_pokers.remove(usera)
userb = random.sample(all_pokers,17)
if len(userb) > 0:
all_pokers = all_pokers.remove(userb)
userc = random.sample(all_pokers,17)
if len(userc) > 0:
all_pokers = all_pokers.remove(userc)
userdizhu = all_pokers
else:
print ERROR
print '玩家A的牌是:'+ usera
print '玩家B的牌是:'+ userb
print '玩家C的牌是:'+ userc
print '地主抢牌:'+ userdizhu
报错:
File "E:/tool/pycharm/PyCharm Community Edition 2017.2/works/doudizhugame.py", line 29, in <module>
print '玩家A的牌是:'+ usera
NameError: name 'usera' is not defined
感谢!!!! |
|