the game of life

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vampiro666
    New Member
    • Mar 2008
    • 1

    #1

    the game of life

    hello, can anyone help me plz. i have an assignment to submit but i am having problem with it. the problem is just below:

    the game of life

    The game of life is a simple cellular automaton where the world is a 2D grid of cells which have two states: alive or dead. After each iteration, the new state of a cell is determined by the state of its neighbors at the previous iteration. This includes both the nearest neighbors and the diagonal neighbors. i.e. like a 9 point stencil without using the value of the cell itself as input. The
    rules for the evolution of the system are:
    • If a cell has exactly two alive neighbors, it maintains state.
    • If a cell has exactly three alive neighbors, it is alive.
    • Otherwise, the cell is dead.
    Your code will need to:
    1. Initialize the game board
    2. Start loop:

    a) Print the gameboard (temporarily for correctness checking)
    b) Calculate number of live neighbors
    c) If (live neighbors = 3) then live
    d) If (live neighbors < 2) or (live neighbors > 3) then die

    3. End loop
    4. Print final game board (again for correctness checking)

    p.s: the program should be written in C language. thnks for your corperation. plz mail me it on <Email removed by a MODERATOR. Please read our Posting Guidelines, found through the Help link at the top of your page.> as soon as possible
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

    Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

    Then when you are ready post a new question in this thread.

    MODERATOR

    Comment

    Working...