Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # NOTE you need the other paste bin called timerandomizer, and you need to save it to the same folder as .py
- from timerandomizer import tr1, tr2, tr3, tr4, tr5, tr6, tr7, tr8 # importing the different "randomizer's"
- # complet list of cards.
- unsorteded = ["HartAce", "Hart2", "Hart3", "Hart4", "Hart5", "Hart6", "Hart7", "Hart8", "Hart9", "Hart10", "HartJack", "HartQueen", "HartKing", "SpadeAce", "Spade2", "Spade3", "Spade4", "Spade5", "Spade6", "Spade7", "Spade8", "Spade9", "Spade10", "SpadeJack", "SpadeQueen", "SpadeKing", "CloverAce", "Clover2", "Clover3", "Clover4", "Clover5", "Clover6", "Clover7", "Clover8", "Clover9", "Clover10", "CloverJack", "CloverQueen", "CloverKing", "DiamondAce", "Diamond2", "Diamond3", "Diamond4", "Diamond5", "Diamond6", "Diamond7", "Diamond8", "Diamond9", "Diamond10", "DiamondJack", "DiamondQueen", "DiamondKing"]
- final = []
- p1 = [] # player 1 hand
- sp1 = [] # payer 1 collection
- p2 = [] # player 2 hand
- sp2 = [] # player 2 collection
- p3 = [] # player 3 hand
- sp3 = [] # player 3 collection
- p4 = [] # palyer 4 hand
- sp4 = [] # player 4 collection
- x = input("to start type 1 here: ") # to start
- i = 0 # counter for how many time i have to do some thing
- # the printing I do that is not in the first if statement is so that I can see what is happening.
- # and I have only commented in the first manipulation of the card to save on time commenting.
- n = tr5(x) # number of times it has to go and do the while loop
- print(n)
- while i != n +2: # here I look at if my counter does not equal the number of times I want to shuffle the cards +2 (use +2 here so that it does not inter fear with anything.)
- print(i)
- if i == n +1: # here I look at if the counter is equal to the number of times it has to shuffle +1, if yes print the list
- print(unsorteded)
- break
- elif i != n +1: # here I look at if the counter is not equal to the number of time it has to shuffle +1
- o = tr1(i) # what is going to happen to the card being manipulated
- if o == 0:
- c = tr4(i) # which card is being manipulated
- y = tr6(i) # the cards new postion
- temp = unsorteded.pop(int(c)) # removes the card form the list and puts it in a temporary int
- print(temp) # i have to print it or i cant insert it in the list for some reason.
- unsorteded.insert(int(y), temp) # inserts the card in its new place
- i = i +1 # adds one to the counter.
- elif o == 1:
- c = tr4(i)
- y = tr7(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(int(y), temp)
- i = i +1
- elif o == 2:
- c = tr4(i)
- y = tr8(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(int(y), temp)
- i = i +1
- elif o == 3:
- c = tr4(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(-1, temp) # here i put the card in at -1 no matter what
- i = i +1
- elif o == 4:
- c = tr4(i)
- y = tr1(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(-int(y), temp) # here it is a random -y value
- i = i +1
- elif o == 5:
- c = tr4(i)
- y = tr8(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(-int(y), temp)
- i = i +1
- elif o == 6:
- c = tr4(i)
- y = tr6(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(-int(y), temp)
- i = i +1
- elif o == 7:
- c = tr4(i)
- y = tr1(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(int(y), temp)
- i = i +1
- elif o == 8:
- c = tr4(i)
- y = tr6(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(int(y), temp)
- i = i +1
- elif o == 9:
- c = tr4(i)
- y = tr7(i)
- temp = unsorteded.pop(int(c))
- print(temp)
- unsorteded.insert(int(y), temp)
- i = i +1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement