fork download
  1.  
  2.  
  3. HP=[i for i in range(1,6)] #hp
  4. AP=[i for i in range(1,4)] #ap
  5. DP=AP #dp
  6. Attribute=[0,1,2] #赤,青,黄
  7.  
  8. import itertools
  9. Deck=[[HP,DP,AP,Attribute] for HP,DP,AP,Attribute in itertools.product(HP,DP,AP,Attribute)] # デッキ
  10.  
  11. import random
  12. User01=random.sample(Deck,1)# 適当に1つ
  13. User02=random.sample(Deck,1)
  14.  
  15.  
  16. Plaza=[]# 広場
  17.  
  18.  
  19. # 属性 有利or不利 無関係
  20. def Attribute_check(x,y):
  21. c=(x-y+3)%3
  22. if c==0:return None #同じ
  23. elif c==2:return True#有利
  24. else:return False#不利
  25.  
  26.  
  27. # 属性 効果 付与
  28. def Grant(x,y):
  29. global User01,User02
  30. if x==0:
  31. if None==Attribute_check(x,y):pass
  32. elif True==Attribute_check(x,y):pass
  33. elif False==Attribute_check(x,y):pass
  34. elif x==1:
  35. if None==Attribute_check(x,y):pass
  36. elif True==Attribute_check(x,y):pass
  37. elif False==Attribute_check(x,y):pass
  38. elif x==2:
  39. if None==Attribute_check(x,y):pass
  40. elif True==Attribute_check(x,y):pass
  41. elif False==Attribute_check(x,y):pass
  42.  
  43.  
  44.  
  45. print(User01,User02)
  46. print(Attribute_check(User01[0][3],User02[0][3]))
  47. Grant(User01[0][3],User02[0][3])
  48. #print(User01,User02)
  49.  
  50.  
Success #stdin #stdout 0.04s 11848KB
stdin
Standard input is empty
stdout
[[3, 3, 3, 2]] [[1, 2, 1, 0]]
True