so i am making a basic game in python (on a raspberry pi) and for a x coordinate i need it to be random and it wont work when i use random.randint() and therefore i dont know what to do:
as said i need x to be a random number and y to stay as -2
def getNewPiece():
shape = random.choice(list(PIECES.keys()))
newPiece = {'shape': shape,
'rotation': random.randint(0, len(PIECES[shape]) - 1),
'x': random.randint(),
'y': -2 ,
'color': random.randint(0, len(COLORS)-1)}
return newPiece
random.randint()always takes 2 arguments; what is the range of values that are allowed forx? Just likerotationandcolor, the number of values that are legal forxis not limitless.