(*by Nasser M. Abbasi*)

ClearAll[t,x1,x2,x3,x4,y1,y2,y3,y4];
ode1=x1'[t]==((x2[t]-x1[t])/(Sqrt[(((x2[t]-x1[t]))^2)+(((y2[t]-y1[t]))^2)]));
ode2=y1'[t]==((y2[t]-y1[t])/(Sqrt[(((x2[t]-x1[t]))^2)+(((y2[t]-y1[t]))^2)]));
ode3=x2'[t]==((x3[t]-x2[t])/(Sqrt[(((x3[t]-x2[t]))^2)+(((y3[t]-y2[t]))^2)]));
ode4=y2'[t]==((y3[t]-y2[t])/(Sqrt[(((x3[t]-x2[t]))^2)+(((y3[t]-y2[t]))^2)]));
ode5=x3'[t]==((x4[t]-x3[t])/(Sqrt[(((x4[t]-x3[t]))^2)+(((y4[t]-y3[t]))^2)]));
ode6=y3'[t]==((y4[t]-y3[t])/(Sqrt[(((x4[t]-x3[t]))^2)+(((y4[t]-y3[t]))^2)]));
ode7=x4'[t]==((x1[t]-x4[t])/(Sqrt[(((x1[t]-x4[t]))^2)+(((y1[t]-y4[t]))^2)]));
ode8=y4'[t]==((y1[t]-y4[t])/(Sqrt[(((x1[t]-x4[t]))^2)+(((y1[t]-y4[t]))^2)]));

sol=NDSolve[{ode1,ode2,ode3,ode4,ode5,ode6,ode7,ode8,x1[0]==0,y1[0]==0,x2[0]==0,y2[0]==1,x3[0]==1,y3[0]==1,x4[0]==1,y4[0]==0},{x1[t],y1[t],x2[t],y2[t],x3[t],y3[t],x4[t],y4[t]},{t,0,1}];

Manipulate[
p1=ParametricPlot[{x1[t],y1[t]}/.sol,{t,0,tMax},AxesOrigin->{0,0},GridLines->Automatic,GridLinesStyle->LightGray,Frame->True,FrameLabel->{{"y",None},{"x",None}},ImageSize->350,PlotStyle->Red]/.Line[x_]:>{Arrowheads[.04],Arrow[x]};

p2=ParametricPlot[{x2[t],y2[t]}/.sol,{t,0,tMax},AxesOrigin->{0,0},GridLines->Automatic,GridLinesStyle->LightGray,Frame->True,FrameLabel->{{"y",None},{"x",None}},ImageSize->350,PlotStyle->Blue]/.Line[x_]:>{Arrowheads[.04],Arrow[x]};

p3=ParametricPlot[{x3[t],y3[t]}/.sol,{t,0,tMax},AxesOrigin->{0,0},GridLines->Automatic,GridLinesStyle->LightGray,Frame->True,FrameLabel->{{"y",None},{"x",None}},ImageSize->350,PlotStyle->Black]/.Line[x_]:>{Arrowheads[.04],Arrow[x]};

p4=ParametricPlot[{x4[t],y4[t]}/.sol,{t,0,tMax},AxesOrigin->{0,0},GridLines->Automatic,GridLinesStyle->LightGray,Frame->True,FrameLabel->{{"y",None},{"x",None}},ImageSize->350,PlotStyle->Green]/.Line[x_]:>{Arrowheads[.04],Arrow[x]};

Show[p1,p2,p3,p4,PlotRange->{{0,1},{0,1}},PlotLabel->Column[{"Solution to the 4 bugs on corner problem","On (0,0),(1,1) square"}],BaseStyle->12,ImageSize->300],

{{tMax,.01,"time"},.01,1,.01,Appearance->"Labeled"}
]