John Conway's Game of Life
Write a Java program to implement the Game of Life, as defined by John Conway:
Any live cell with fewer than two live neighbors dies, as if caused by under-population.
Any live cell with two or three live neighbors lives on to the next generation.
Any live cell with more than three live neighbors dies, as if by overpopulation.
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
Your program should use a 20 x 20 grid, and accept the initial grid configuration in a form similar to the following (this example would be for a 4 x 4 grid):
....
.XX.
.XX.
....
5
Where the dot (period) indicates an empty square, and some other character (‘X’ in the example) indicates an inhabited square. The last line of the file will contain an integer value, indicating the number of generations to compute. Your program should compute and show the final configuration in the same format as the input.
Think about proper class design, loosely-coupled classes, testability, etc.