Hi! Can any c programmers there help me with this assignment please? I really do not get my lecturer.
Conway's life is a special kind of game. It isn't really a game - just a spectator sport. It is played on a chess board, where each cell is either alive or dead. Each turn consists of deciding which squares on the board stay the same or change (becoming either alive or dead) and then admiring the new pattern they produce.
A live square stays alive if it has exactly two or exactly three live neighbours, otherwise it dies.
A dead square becomes alive if it has exactly three live neighbours, otherwise it stays dead.
All births and deaths occur simultaneously. The next round depends only on the positions at the end of the previous round. A neighbouring square is one step away in any direction (including diagonals).
Write a program that uses a 20x20 board, initialised to a given pattern, to play the game. After each turn print out the board pattern using a . for a dead square and a * for a live square. Squares off the board are considered permanently dead.
Hint: you need two 2-D arrays (both global variables). Each one being an array of strings. Form the second array from the first array, using the above rules, then copy it back to the first array, print it and repeat. After each repetition ask the user whether they want to continue or stop.
If your program is working correctly this pattern should show a glider hitting a brick
**..................
**..................
....................
....................
....................
....................
....................
........***.........
........*...........
.........*..........
....................
all the remaining rows are filled with dead squares.
Find another shape, like the brick, that is stable from one generation to another. Include it in a comment in your program.