Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created December 24, 2017 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/ed57316930b3f892fe751710979b99fb to your computer and use it in GitHub Desktop.
Save ssaurel/ed57316930b3f892fe751710979b99fb to your computer and use it in GitHub Desktop.
Conway's Game of Life Tutorial for the SSaurel's Blog
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