Last active
December 23, 2016 18:32
-
-
Save Chryus/46f79f4259e41cef22841f214c1bc957 to your computer and use it in GitHub Desktop.
Cell class from Conway's game of life
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
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