Ejemplo n.º 1
0
def convertPiecesToDict(pieces,boardLength):
    """
    This function takes a list of tuples with shape information
    as input: eg. [(L_shape,4,L), (T_shape,4,T)] and converts them
    them to dictionary eg. : {'L':[1,2,6,10], 'T':[2,6,7,8,9]}
    """
    outDict = {}
    for piece in pieces:
        splitUp = pp3.getPiece(piece)
        outDict[splitUp[2]]=pp3.createShape(splitUp[0],splitUp[1],boardLength)
    return outDict
Ejemplo n.º 2
0
def convertPiecesToDict(pieces,boardLength):
	outDict = {}
	for piece in pieces:
		splitUp = pp3.getPiece(piece)
		outDict[splitUp[2]]=pp3.createShape(splitUp[0],splitUp[1],boardLength)
	return outDict