MAZE GENERATION PROBLEM PLEASE HELP

hi im new to openGL, i have this project which is suppose to generate a random NXM grid, then slowly eat away the walls to create a full maze the maze must be proper meaning you can get from one cell to any other cell,im suppose to represent the maze with 2 arrays northwall[i][j] and eastwall[i][j], then if northwall[i][j]==1 then the north wall of the cell is present,and so on its suppose to start in a random cell and eat away the walls randomly, i have no idea how to do this please help!!!

Homework? Since this is mainly for openGL programming, and I don’t see a specific openGL Question, I’d look elsewhere. I know I have seen maze generators, check google, or deja.com and do a search. I am sure you’ll find plenty.