Still learning python3 and im currently creating a domino game. I'm making progress so far but i haven't been working with functions at all.
My question is: How do i get the domino_stock_set into my split_stones function so i can split it up?
Seems like a dumb question but i googled half an hour and couldn't find anything that would work. I tried anything so at this point i might have several erros in the script.
import random
random_hand = random.randint(0, 7)
random_sixseven = random.randint(6,7)
def stock_set():
global domino_stock_set
domino_stock_set = []
for i in range(0, 7):
for j in range(i, 7):
domino_stock_set.append([i, j])
random.shuffle(domino_stock_set)
print()
print("…ᘛ⁐̤ᕐᐷ -Stock Set- …ᘛ⁐̤ᕐᐷ")
print(domino_stock_set)
print()
return domino_stock_set
def split_stones(domino_stock_set, wanted_parts=1):
length = len(domino_stock_set)
return [ domino_stock_set[i*length // wanted_parts: (i+1)*length // wanted_parts]
for i in range(wanted_parts) ]
print("==============P L A Y E R==================")
print(split_stones(domino_stock_set, wanted_parts = random_sixseven))
print("=============C O M P U T E R===============")
print(split_stones(domino_stock_set, wanted_parts = random_sixseven))
stock_set()
split_stones()