# The pc has this cards and it has to choose
pc1 = ['9♠', '1♥', '8♣']
# Let's see what briscola we have
briscola = pop(1)
print(briscola)
['2♣']
Nice!
Now, lets make a function to choose the first cards (A.I.?)
def choose(cards):
cardschoice = [] # here I'll put my cards
for c in cards:
if c[-1] != briscola[0][-1]: # I will choice only normal cards
cardschoice += [c]
number = len(cardschoice)
if number == 0: # if the cardschoice is empty there are only briscole
print("tutte briscole / you have all briscole")
elif number==1: # 2 briscole
print("Hai due briscole e un'altra carta / 2 briscole and 1 other")
elif number ==2: # 0 briscole
print("Hai una briscola e due carte normali / 1 briscola and 2 normal ones")
else: # all briscole
print("Non hai briscole / you don't have briscole")
print(pc1)
print(briscola[0][-1])
choose(pc1)
['9♠', '1♥', '8♣']
♣
Hai una briscola e due carte normali
Now we got to make pc1 to make a different decision for each case.
Comments
Post a Comment