Game of Life Program Help

This is a discussion on Game of Life Program Help within the C++ Programming forums, part of the General Programming Boards category; Ok I need to get the program of life working but i have no source code to work from and ...

  1. #1
    Unregistered
    Guest

    Unhappy Game of Life Program Help

    Ok I need to get the program of life working but i have no source code to work from and have no clue where to startit has to be a 20x20 grid and the user must tell where the cells begin to grow i have a grid thats 20x20 and it ask where it starts but I need to figure out how to replace one of the characters


    00000000
    00000000
    00000000
    00000000
    000X0000 like put an X here
    00000000
    00000000
    00000000

    any help would be great and im using Microsoft visual C++

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    make a grid..... 2 dimensional array....

    char grid [20][20]={0};

    then to change a char....

    grid [10][10]='X';
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    I think the rules of life are:

    1. If a cell is surrounded by at least 3 cells, then it is allowed to grow.

    2. If a cell is surrounded by more than 3 cells, then it dies.

    Look it up on the web as I'm sure there are more rules than this. Used to have this on my system, but it's long since vanished.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2D Game project requires extra C++ programmers, new or experienced
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 05-16-2007, 11:46 AM
  2. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 01:48 AM
  3. interfacing a program with a game
    By dragonklown in forum C++ Programming
    Replies: 3
    Last Post: 02-17-2005, 12:59 AM
  4. viewport window for life program
    By rip1968 in forum Windows Programming
    Replies: 1
    Last Post: 04-01-2003, 11:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21