You can make a dictionary for the spaces. You can type out the dictionary or do this
mapDict = {} for x in range(1, 17): #repeat 16 times mapDict.update({x : None}) #None means it isn't occupiedThis function will check if the card can be moved
def CheckIfPossible(direction, space): #direction is the direction they are trying to move the card in. space is the space the card is in coordDict = {'x1' : 'left', 'x4' : 'right', 'y1' : 'up', 'y4' : 'down'} #Directions the card cannot go if at a specific coord y = #Get y coord as in 2 if it were in the 2nd row x = #Get x coord for example 1 if it were in the first column if x == 1 and coordDict['x1'] == direction.lower(): return False elif x == 4 and coordDict['x4'] == direction.lower(): return False elif y == 1 and coordDict['y1'] == direction.lower(): return False elif y == 4 and coordDict['y4'] == direction.lower(): return False return TrueHope this helps!