Randomizing Stone Placements on my Game (Help)

(LVL 1 Maze)

(LVL 2 Maze Has 5 Openings)

I want to make it randomly set a maze that has a set number of openings and have it actually possible. I’m making a defense game so there will be enemies coming through the entrances. I’m also planning on placing a tower randomly which the player hss to defend.