In all of my previous games, the maps I have all have predetermined spots. While that is interesting and certainly important just because it allows a coherent game that focuses more on story, I have wanted to make a maze generation game for a long time. I plan on making a game on the home screen where its kind of like a luigis mansion game. I want to generate a maze within a matrix and use that matrix to arrange the different rooms that way the mansion is completely randomly generated so that way even I dont know the answer. I know that its possible to randomly generate a maze on the calculator but I don´t know how. Could someone please send me some source code for generating a maze and explain the logic behind it? Thanks!

Maze Generation

Summary:

How to make it so I don´t know the layout of a particular map.