Created
December 24, 2017 14:24
-
-
Save ssaurel/ed57316930b3f892fe751710979b99fb to your computer and use it in GitHub Desktop.
Conway's Game of Life Tutorial for the SSaurel's Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ssaurel.gameoflife; | |
public class Cell { | |
public int x,y; | |
public boolean alive; | |
public Cell(int x, int y, boolean alive) { | |
this.x = x; | |
this.y = y; | |
this.alive = alive; | |
} | |
public void die() { | |
alive = false; | |
} | |
public void reborn() { | |
alive = true; | |
} | |
public void invert() { | |
alive = !alive; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment