<<GraphicsSetUp.m

spreading[n_Integer,p_Real:-1.0]:= 
  Module[
   {cluster = {{0, 0}}, choices = {{1, 0},{0, 1},{-1, 0},{0, -1}},  
     per = Transpose[{{{1,0},{0,1},{-1,0},{0,-1}}, Table[Random[],{4}]}], 
                                  perTocluster, nn, new, newper, testsite},

  
    perTocluster := 
      (Module[{nn, new, newper},
              AppendTo[cluster, Flatten[#, 1][[1]] ];
                                 per = Complement[per, #];
                                 nn = Map[Function[x, x + Last[cluster]], choices]; 
                                                       new = Complement[nn, cluster, Transpose[per][[1]] ];
                                        newper = Transpose[{new,Table[Random[],{Length[new]}]} ];
                                                       per = Join[per,newper]])&;
                          
 While[Length[cluster] < n + 1 && Length[per] >0,
        testsite = Random[Integer,{1, Length[per]}];
                                                                Which[ 
                                          p < 0, perTocluster[Cases[per,{{x__}, Min[Transpose[per][[2]]]}]],
                                          per[[testsite, 2]] <= p, perTocluster[{per[[testsite]]}], 
                                           True, per = Complement[per, {per[[testsite]]}] ] 
                                         ];
Show[Graphics[
 {Map[(Rectangle[#-{0.5,0.5},#+{0.5,0.5}])&,cluster]}]
,
  AspectRatio -> 1, PlotRange->Map[({Min[#], Max[#]})&,Transpose[cluster]]]

       ]

Show[GraphicsArray[
	{{spreading[5],spreading[9],spreading[16]},
	 {spreading[27],spreading[28],spreading[101]}},
	 GraphicsSpacing->{0.35,0.3}]]

Do[spreading[n],{n,1,10}]

Show[GraphicsArray[
	{spreading[16,-1.0],spreading[16,0.1],
		spreading[16,1.0]},
	GraphicsSpacing->{0.35}]]

Show[GraphicsArray[
	{spreading[97,-1.0],spreading[97,0.2],
		spreading[97,1.0]},
	GraphicsSpacing->{0.35}]]