Randomly Generated Level (Level, not terrain)

Ok,

So I have five or so different room models. These are all tillable, meaning; they are all the same size (5x5) and can be placed next to eachother, and would seamlessly blend together.

For my game, I need the level to be randomly generated at the start of the game. I also would need to the size to be able to be customised, say, change it from 5x5 to 18x69 at the click of a button, (Or change of integer).

I am an OK at scripting, but I have no idea where to start this.
At the moment I am thinking of generated a image X wide and X high, and only have 5 different colours, and have Unity place rooms according to the colour, but I have no idea whether this would be the best way to do it, or how to do this. Any ideas?

Thanks.

That would be a good approach, although you can skip generating the image and directly spawn your objects from the data ( you need the data to generate the image anyway )

Take a look at this, it might give you a good explanation. Also there is a Java example, which is not too hard to convert to C#
http://roguebasin.roguelikedevelopment.org/index.php?title=Dungeon-Building_Algorithm

It would be simpler just to use a 2D array.

–Eric