Ryan

Ryan

  • NA
  • 2
  • 0

incrumenting and outputting an array value

Nov 4 2006 3:49 AM
Hi everyone, I've got a problem with a console application I'm trying to build. I have two values, x and y which are set. The x and y values are changing every 0.5 of and being outputted to a console screen with an "*" zipping round the screen. I'm trying to store the x and y co-ordinates in an array so that more asteriks can be added to the array by incrumenting the values by plus or minus to allow one asteriks to follow another on screen Here is the code I have produced so far: int[] sLengthX = new int[4];//set length of the asteriks x value int[] sLengthY = new int[4];//set length of the asteriks y value for (int i = 0; i < sLengthY.Length; i++) //Loop to make longer { Console.Clear(); x = x + xSpeed; int sIntLengthX = x; sLengthX[i] = (sIntLengthX); y = y + ySpeed; int sIntLengthY = y; sLengthY[i] = (sIntLengthY); for(int j=0; j > 5; j++)//loop round to create length of 5 asteriks with cursor position set { Console.SetCursorPosition(sLengthX[i] + "," + sLengthY[i]); Console.Write("*"); } Thanks for the help