Problems with Conways Game of Life (in java)
<p>I'm trying to write conways game of life in Java but it's not working as it should. By that I mean, still lifes work but blinkers and ships do not.</p>

<p>Here is the code for my algorithm, the seeding is handled by a seperate mouse listener (which is working as intended).</p>

<pre><code>    int[][] state1 = new int[80][80];
    int[][] state2 = new int[80][80];
    public void logic(){
        state2=state1;
        for(int i=0;i&lt;80;i++){
            for(int j=0;j&lt;80;j++){
                int sum=state1[(i-1+80)%80][j]+state1[(i-1+80)%80][(j-1+80)%80]+state1[i][(j-1+80)%80]+state1[(i+1)%80][(j-1+80)%80]+state1[(i+1)%80][j]+state1[(i+1)%80][(j+1)%80]+state1[i][(j+1)%80]+state1[(i-1+80)%80][(j+1)%80];

                if(sum!=2 &amp;&amp; sum!=3){
                    state2[i][j]=0;
                }
                else if(sum==3){
                    state2[i][j]=1;
                }
            }
        }
        state1=state2;
    }
</code></pre>
