import java.util.Random;
import java.io.*;

public class CellSimulation
{
   public static void main( String[] args ) throws IOException
   {

      FileWriter outfile = new FileWriter( "coordinateData.data" );
      Random randomNumerGenerator = new Random();
      double randomNumber;
      String coordinates = new String("");
      double x = 0.0;
      double y = 0.0;


      int[][] grid = new int[1000][1000];
      cell A = new cell("A");
      //A.showGraphics();

	  for(int i=0; i<20; i++)
	  {
	  System.out.println("speed: " + A.getSpeed() + " direction: " + A.getDirection() + " runtime: " + A.getRuntime());
	  double stopFrame = A.getStopFrame();
      System.out.println("frames: " + stopFrame + " total distance:  " + A.getTotalDistance() + " interval distance: " + A.getIntervalDistance());

      while(A.getCurrFrame() < stopFrame)
      {
		 //System.out.println("Frame: " + A.getCurrFrame() + " X: " + A.getNextX() + " Y: " + A.getNextY());
         A.getCurrFrame();
         x = A.getNextX();
         y = A.getNextY();
         A.incrementFrame();
         coordinates += A.getCurrX() + " " + A.getCurrY() + '\n';

      }
      //A.makeIncrementMove();
      //coordinates += A.getCurrX() + " " + A.getCurrY() + '\n';
      //System.out.println("Frame: " + A.getCurrFrame() + " " + A.getArrayX(A.getCurrX()) + " " + A.getArrayY(A.getCurrY()) );
      }

      outfile.write( coordinates );
	  outfile.flush();
      outfile.close();


   }
}



46


