def maze_generator(x, y, size):
    mr = np.random.uniform(0, 1, (size, size))
    mg = np.random.uniform(0, 1, (size, size))
    mb = np.random.uniform(0, 1, (size, size))
    mapr = np.random.choice([0, 0, 0, 0, 1], (size, size))
    maps = np.random.choice([0, 0, 0, 0, 1], (size, size))
    mapt = np.random.choice([0, 0, 0, 1, 2], (size, size))
    maptemp = np.random.choice([0, 0, 1], (size, size))
    maph = np.random.uniform(0.25, 0.99, (size, size))
    maph[np.where((maptemp == 0))] = 0
    (maph[0, :], maph[(size - 1), :], maph[:, 0], maph[:, (size - 1)]) = (1, 1, 1, 1)
    (maps[0, :], maps[(size - 1), :], maps[:, 0], maps[:, (size - 1)]) = (0, 0, 0, 0)
    (maph[x][y], mapr[x][y]) = (0, 0)
    count = 0
    while 1:
        (testx, testy) = (x, y)
        if (np.random.uniform() > 0.5):
            testx = (testx + np.random.choice([(- 1), 1]))
        else:
            testy = (testy + np.random.choice([(- 1), 1]))
        if ((testx > 0) and (testx < (size - 1)) and (testy > 0) and (testy < (size - 1))):
            if ((maph[testx][testy] == 0) or (count > 5)):
                count = 0
                (x, y) = (testx, testy)
                (maph[x][y], mapr[x][y]) = (0, 0)
                if (x == (size - 2)):
                    (exitx, exity) = (x, y)
                    break
            else:
                count = (count + 1)
    return (mr, mg, mb, maph, mapr, exitx, exity, mapt, maps)
def maze_generator(x, y, size):
    mr = np.random.uniform(0, 1, (size, size))
    mg = np.random.uniform(0, 1, (size, size))
    mb = np.random.uniform(0, 1, (size, size))
    mapr = np.random.choice([0, 0, 0, 0, 1], (size, size))
    maps = np.random.choice([0, 0, 0, 0, 1], (size, size))
    mapt = np.random.choice([0, 0, 0, 1, 2], (size, size))
    maptemp = np.random.choice([0, 0, 1], (size, size))
    maph = np.random.uniform(0.25, 0.99, (size, size))
    maph[np.where((maptemp == 0))] = 0
    (maph[0, :], maph[(size - 1), :], maph[:, 0], maph[:, (size - 1)]) = (1, 1, 1, 1)
    (maps[0, :], maps[(size - 1), :], maps[:, 0], maps[:, (size - 1)]) = (0, 0, 0, 0)
    (maph[x][y], mapr[x][y]) = (0, 0)
    count = 0
    while 1:
        (testx, testy) = (x, y)
        if (np.random.uniform() > 0.5):
            testx = (testx + np.random.choice([(- 1), 1]))
        else:
            testy = (testy + np.random.choice([(- 1), 1]))
        if ((testx > 0) and (testx < (size - 1)) and (testy > 0) and (testy < (size - 1))):
            if ((maph[testx][testy] == 0) or (count > 5)):
                count = 0
                (x, y) = (testx, testy)
                (maph[x][y], mapr[x][y]) = (0, 0)
                if (x == (size - 2)):
                    (exitx, exity) = (x, y)
                    break
            else:
                count = (count + 1)
    return (mr, mg, mb, maph, mapr, exitx, exity, mapt, maps)