coding help

I can't seem to print or update the count value in this code

import java.util.Random;

import java.io.*;

publicclass InputRandom

{

publicstaticvoid main (String[]args)throws IOException

{

//int y = 6%3;

//System.out.println(y);

BufferedReader console =new BufferedReader(new InputStreamReader(System.in));

System.out.println("How many nodes does the graph have?");

String input = console.readLine();

int x = Integer.parseInt(input);

int i = 1;

Random generator =new Random();

int r = generator.nextInt(2);

//int count = 0;

//count++;

//System.out.print(count);

int[] array =newint[x];

//System.out.println(r);

ArrayCheck arrayCheck =new ArrayCheck();

while( arrayCheck.isFull(array))

{

int count = 0;

if(i==1 && r==0)

{

i=x;

count = count;

array[i]=i-1;

count=count+1;

System.out.println(r);

arrayCheck.isFull(array);

System.out.print(count);

r = generator.nextInt(2);

}

if(i==x)

{

i= 1;

count=count;

count=count+1;

array[i]=i-1;

arrayCheck.isFull(array);

System.out.print(count);

}

elseif(i==1 && r==1)

{

i=i+1;

count=count+1;

array[i]=i-1;

arrayCheck.isFull(array);

System.out.print(count);

}

//System.out.print(count);

while(i == x && r ==1)

{

i = 0;

}

//int s = generator.nextInt(2);

if(i > 1 && r == 0 )

{

i = i-1;

count=count+1;

array[i]=i-1;

arrayCheck.isFull(array);

r = generator.nextInt(2);

}

elseif (i > 1 && r==1)

{

i=i+1;

count=count+1;

array[i]=i-1;

arrayCheck.isFull(array);

r = generator.nextInt(2);

}

System.out.println(count);

}

}

}

[3650 byte] By [simmasterp1a] at [2007-11-26 12:22:11]
# 1
arrayCheck.isFull(array)Is this method return true in your while condition?
LRMKa at 2007-7-7 15:15:01 > top of Java-index,Archived Forums,Socket Programming...
# 2
take the count variable out of the while loop. After each iteration of the while loop, count gets set back to 0. you should try refactoring too. There is a lot of code duplication here.
pokaria at 2007-7-7 15:15:01 > top of Java-index,Archived Forums,Socket Programming...