Prevent Incrementing
<p>I have a somewhat trivial issue at hand. So I'm trying to stop my counter, c, from incrementing the for loop. I'm trying to fill in a spot in the pond ONLY if its empty. If its already filled with another fish (white or red), I don't want the counter to increment. Once a spot (or element rather) in the pond is filled, it can't be filled again. So it should have 500 white fishes and 5 red fishes by the end.</p>

<p>I feel as if I'm using the wrong conditional statement to approach this problem. Once my counter increments, so does my while statement that called the method, placeFish, increments the white or red counters as well, which is not what I want to do. I keep getting total amounts of white/red fishes that are not 500 nor 5, but rather lower because the while counters are increasing when ideally I don't want them to.</p>

<p>Am I correct in using a for statement? I tried while, but it didn't seem to work either.</p>

<pre><code>public static void fishes (int[][] pond) {
            //pond has dimensions [50][50] in a different method that call fishes
            //every element in the 2D array pond is already set to value 0
    int whitefish = 500;
    int redfish= 5;
    int whitefishvalue = 1
    int redfishvalue = 2
    int white = 0;
    int red = 0;
    while (white &lt; whitefish)
    {
        placeFish (pond, whitefishvalue);
        white++;
    }
    while (red &lt; redfish) 
    {
        placeFish (pond redfishvalue);
        redd++;
    }
}

public static void placeFish(int[][] pond, int newFish) {
    int a = random.nextInt(pond.length);
    int b = random.nextInt(pond[0].length);
            int spot = 0;

    for (int c = 0; c &lt; 1; c++)
    {
        if (pond [a][b] == spot)
        {
            pond[a][b] = newFish;
            c++;
                    //How to stop c++ from incrementing?
        }
    }
}
</code></pre>
