Skip to content

Instantly share code, notes, and snippets.

@Chryus
Last active December 23, 2016 18:32
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 Chryus/46f79f4259e41cef22841f214c1bc957 to your computer and use it in GitHub Desktop.
Save Chryus/46f79f4259e41cef22841f214c1bc957 to your computer and use it in GitHub Desktop.
Cell class from Conway's game of life
class Cell {
constructor(alive, x, y) {
this.alive = alive;
this.x = x;
this.y = y;
}
die () { this.alive = false; }
revive () { this.alive = true; }
isAlive () { return this.alive; }
dead () { return !this.alive; }
}
export default Cell;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment