This program is meant as a homework from Generasi Gigih program. We need to write Game of Life with the most beautiful code that we can write, with the details as:
- The problem statement can be found on Wikipedia (Keyword: Conway's Game of Life)
- Use Java as the language
- Write the most beautiful code as possible
- The format of input and output is up to you
- Infinite grid is possible, array out of bound exception is possible
- Commit at most every 10 mins
- You need to keep it only in your local Git
And the rules of Game of Life are:
- Any live cell with fewer than two live neighbours dies, as if by underpopulation.
- Any live cell with two or three live neighbours lives on to the next generation.
- Any live cell with more than three live neighbours dies, as if by overpopulation.
- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
These rules can be concluded as:
- Any live cell with two or three live neighbours survives.
- Any dead cell with three live neighbours becomes a live cell.
- All other live cells die in the next generation. Similarly, all other dead cells stay dead.
- Have an IDE for Java installed (e.g. Netbeans, Intellij, Eclipse)
- JDK with min. version of 11.0
- JUnit 5.0 or higher installed (for running the tests)
- Open a terminal
- Change the working directory into the current project directory
- Execute
javac src/main/Grid.java
in your terminal
Or in Intellij, you can simply click the run button on the left side of the file
- Open a terminal
- Change the working directory into the current project directory
- Execute
javac src/test/GridTest.java
in your terminal