Well, you could check the bounds of each generated room before adding it. Or you could let rooms overlap, and just overlay them, which would let you get more complex shapes from just generating rectangles.

I've got a Sil level 3 application ro control, should I use a partitioned PLC to garuntee safety or use an independently wired relay solution?

BTW, we are making sodium azide.[/b]
I can't even tell if that makes sense or not . I don't know if I should be happy or sad. Universities don't teach the good stuff anymore I guess. Bet that makes you happy with the state of your job security