There is a perl program you can find at this link:
[url removed, login to view]
The program generates a randomized dungeon grid based on a variable input. You can see the program in action as a CGI here: [url removed, login to view]
1) The program should not generate an image, but rather should return a simple array of arrays based grid structure of ints whereby the type of cell is represented by a given integer.
2) The function that generates the grid should receive the map parameters as function params. These should be Map Style, Dungeon Size, Layout, Room Size, Room Layout, Doors, Cooridors, Remove Deadends, Add Stairs
Note: You should ignore Grid Type - only square. Also ignore "cavernous" layout.