My Java code will not run, why? (Only a few lines)
<p>I had to write this for a class project. I don't get any errors when compiling, but the program won't run when I attempt to execute it.</p>

<p>We have to write a program myRandomWalkers.java that takes two command-line arguments N and T. In each of T independent experiments, simulate a random walk of N steps and compute the squared distance. Output the mean squared distance (the average of the T squared distances).</p>

<p>I wrote the following:</p>

<pre><code>public class myRandomWalkers {

    public static void main(String[] args) {

        int n= Integer.parseInt(args[0]);
        int t= Integer.parseInt(args[1]);
        int x= 0; // starting x position
        int y= 0; // starting y position
        int sum = 0; // for calculating mean square distance
        double r;

        int count = 0;
        while (count &lt;= t)
        {
            for (int i=0; i&lt;n; i++) {

                r= Math.random();
                if (r&lt;=0.25) x++;
                else if(r&lt;=0.50) x--;
                else if(r&lt;=0.75) y++;
                else if(r&lt;=1.0) y--;        

                int z = ((x*x) + (y*y));
                sum +=z;
            }
        }

        int average = (sum/t);
        System.out.println ("mean squared distance = " + average);
    }        
}
</code></pre>

<p>Thanks in advance!</p>
