x[0]=0;
y[0]=0;
for(i=0;i<N-1;i++)
{
if(x[i]<1) x[i+1]=x[i]+Vx*dt;
else x[i+1]=x[i]-Vx*dt;
Help! I want the coordinates x[i] change from 0 over +1 to -1 and back as often as i<N. The program counts from 0 up to 1 - O.K. - but then oscillates from 1 to 0.9 and so on.