Last active
January 28, 2020 00:20
-
-
Save kitwalker12/419ffc7ea900bdba18c23810e84a4464 to your computer and use it in GitHub Desktop.
Game of Life Boilerplate
This file contains hidden or 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
| public class GameOfLife { | |
| GameOfLife() { // state may be passed here | |
| } | |
| public void evolve { | |
| } | |
| public void print { | |
| } | |
| } | |
| // GameOfLife life = new GameOfLife | |
| // life.evolve() | |
| // life.print() |
This file contains hidden or 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
| var GameOfLife = { | |
| init: function() { | |
| }, | |
| evolve: function() { | |
| }, | |
| print: function() { | |
| } | |
| }; |
This file contains hidden or 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 GameOfLife | |
| attr_accessor :state | |
| def initialize(state) | |
| end | |
| def evolve | |
| end | |
| def print | |
| end | |
| end | |
| # life = GameOfLife.new | |
| # life.evolve | |
| # life.print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
constforGameOfLifein JSto_sinstead ofprint(and make this work withp instance,puts instancein Ruby