def DrawHexagon(puzzle):
    angle = 30
    figure = GCompound()
    figureinside = GCompound()
    hexagon = createHexagon(HEX_SIDE)
    hexagon.setFilled(True)
    hexagon.setColor(CENTER_HEX_COLOR)
    figureinside.add(hexagon)
    labelinside = GLabel(puzzle[0])
    labelinside.setFont(LABEL_FONT)
    figureinside.add(labelinside, -0.38 * labelinside.getWidth(), HEX_LABEL_DY)
    figure.add(figureinside)

    for i in range(1, 7):

        figureinside = GCompound()
        hexagon = createHexagon(HEX_SIDE)
        hexagon.setFilled(True)
        hexagon.setColor(OUTER_HEX_COLOR)
        figureinside.add(hexagon)
        labelinside = GLabel(puzzle[i])
        labelinside.setFont(LABEL_FONT)
        figureinside.add(labelinside, -0.38 * labelinside.getWidth(),
                         HEX_LABEL_DY)
        figureinside.movePolar(HEX_SEP, angle)
        angle += 60
        figure.add(figureinside)
    gw.add(figure, GWINDOW_WIDTH / 2, GWINDOW_HEIGHT / 2)
def createBeehive(puzzle):

    #This function takes the parameter as string and outputs the beehive
    angle = 30
    figure = GCompound(
    )  #This will store the whole beehive and is the output of the function in the end
    figureinside = GCompound(
    )  #This will store the intermediate values to be put into figure
    hexagon = createHexagon(HEX_SIDE)
    hexagon.setFilled(True)
    hexagon.setColor(CENTER_HEX_COLOR)
    figureinside.add(hexagon)
    labelinside = GLabel(puzzle[0])

    labelinside.setFont(LABEL_FONT)
    figureinside.add(
        labelinside, -0.5 * labelinside.getWidth(), HEX_LABEL_DY
    )  #Using -0.5 times label width tends to center the label more
    figure.add(figureinside)

    for i in range(1, 7):

        figureinside = GCompound()
        hexagon = createHexagon(HEX_SIDE)
        hexagon.setFilled(True)
        hexagon.setColor(OUTER_HEX_COLOR)
        figureinside.add(hexagon)
        labelinside = GLabel(puzzle[i])
        labelinside.setFont(LABEL_FONT)
        labelinside.setLocation(-0.5 * labelinside.getWidth(), HEX_LABEL_DY)
        figureinside.add(labelinside)
        figureinside.movePolar(HEX_SEP, angle)
        angle += 60
        figure.add(figureinside)

    return figure