Add a local variable "b".
Change your loop to this: "While b=0"
Inside the loop generate random X and Y, do your overlapping checks and when the suitable position is found, set b=1
I also advise to add another condition to the While loop: loopindex<100
This is to prevent infinite loop in case there is no free space left on the map.