Preparation for project on "Game of Life".

The "Game of Life" was invented by John H. Conway to simulate the birth and death of cells in a society. It really isn't a "game", but a simulation of population growth that is displayed over time.

Game Rules:

In this lab you will write and test the following functions

  1. def build_board_random(row, col) - this function fills the board with random numbers 0 and 1. A live organism is represented by 1 and a dead organism is represented by 0. The sizes of the board will be user input and determine in main
  2. def build_board_user(row, col) this function fills the board with user input: 0 and 1. A live organism is represented by 1 and a dead organism is represented by 0.
  3. def printBoard(board, row, col) - prints the board (prints 2-d list in matrix form) - we wrote this function already
  4. def copyBoard(board, row, col) - creates and returns the copy of the board
  5. def change(oldBoard, newBoard, row, col) - returns 1 if both 2-d lists, oldBoard and newBoard, are the same, and 0 otherwise
  6. def count(board, row, col) - counts and returns the number of live organisms
  7. def neigh(board, row, col, i, j) - finds and returns the number of live organisms around the cell position i, j
  8. def all_neigh(board, row, col) - this function creates a 2-d list, with each element equals to the number of live organisms of 2-d list scores. The function returns a new list.