so the program runs well. The issue is, if I want to play again, it calls the same random numbers each time. How do I make it so I calls a different random number and card each time I want to play again? Thanks.
import random
import math
import time
import sys
Hearts = "Hearts"
Clubs = "Clubs"
Diamonds = "Diamonds"
Spades = "Spades"
number1 = [1,2,3,4,5,6,7,8,9,10]
number1 = random.choice(number1)
number2 = [1,2,3,4,5,6,7,8,9,10]
number2 = random.choice(number2)
number3 = [1,2,3,4,5,6,7,8,9,10]
number3 = random.choice(number3)
card1 = [Hearts, Clubs, Diamonds, Spades]
card1 = random.choice(card1)
card2 = [Hearts, Clubs, Diamonds, Spades]
card2 = random.choice(card2)
card3 = [Hearts, Clubs, Diamonds, Spades]
card3 = random.choice(card3)
blacklist = ["King" "Queen", "Jack"]
blacklist = random.choice(blacklist)
ace = ["Ace"]
ace = random.choice(ace)
runningtotal = number1 + number2
roundtotal = runningtotal + number3
def startup():
print("Starting game... Your first cards are being drawn")
round1()
def round1():
if number1 == 10:
print ("{} of {}".format(blacklist, card1))
round2()
elif number1 == 1:
print("{} of {}".format(ace, card1))
round2()
else:
print ("{} of {}".format(number1, card1))
round2()
def round2():
if number2 == 10:
print ("{} of {}".format(blacklist, card2))
round3()
elif number2 == 1:
print("{} of {}".format(ace, card2))
round3()
else:
print ("{} of {}".format(number2, card2))
round3()
def round3():
startr3 = input("Would you like to be dealt another card? Your total is... {}".format(runningtotal))
if startr3 == "yes":
if number3 == 10:
print("{} of {}".format(blacklist, card3))
elif number3 == 1:
print("{} of {}".format(ace, card3))
else:
print("{} of {}".format(number3, card3))
if roundtotal >= 22:
loose()
else:
print("You win!")
again = input("Do you want to play again?")
if again == "yes":
round1()
elif again == "no":
endgame()
def endgame():
print("Thankyou for playing")
def loose():
looseg = input("Your total was above 21! Do you want to play again?")
if looseg == "yes":
number1()
elif looseg == "no":
endgame()
startup()