| ||
procedure(Sequencing(listX)
foreach(obj listX
BeginPt=car(listX~>beginPt)
EndPt=car(listX~>endPt)
Bx=car(BeginPt)
By=car(cdr(BeginPt))
Ex=car(EndPt)
Ey=car(cdr(EndPt))
cenHeng=int((Bx+Ex)/2)
cenShu=int((By+Ey)/2)
listX~>endPt=list(cenHeng cenShu)
if(Bx>Ex
then cenHeng=Ex
Ex=Bx
Bx=cenHeng
else nil
);if
if(By>Ey
then cenShu=Ey
Ey=By
By=cenShu
else nil
);if
);for
listX~>beginPt=list(Bx By)
listX~>endPt=list(Ex Ey)
);procedure make the beginPt<EndPt