if(nbIteration>500*numberOfRooms){// The size of the map is initially 10*10 and while in 2000 iterations the rooms aren't created the size increases by a factor of 1.1
return(dY>0&&dX>0)?dX+dY+4:dX+dY;// There's an extra to the distance between rooms that aren't facing each other horizontally or vertically (to avoid corridors with corners in the MST when possible)
}
/**
* Create corridor(s) between two rooms
* If the two rooms are facing each other there will be only one corridor
* Other wise there will be two corridor since the rooms wills be linked by a "corner corridor"
if(nbIteration>500*numberOfRooms){// The size of the map is initially 10*10 and while in 2000 iterations the rooms aren't created the size increases by a factor of 1.1