Thread: Having trouble with my game

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    19

    Having trouble with my game

    I have to write the game of life programm for my class. Keep in mind this is my first programming class and i hardly know anything. Well anyways i cant figure out how to check the neighbors. What do I do. got any examples? Help is much appreciated.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    What type of data structure are you using? If it's just a two dimensional array then all you have to do to check the neighbors is
    up = current[i - 1][j];
    down = current[i + 1][i];
    left = current[i][j - 1];
    right = current[i][j + 1];

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. C# - Building a SCUMM-like game.. questions
    By Iyouboushi in forum Game Programming
    Replies: 0
    Last Post: 05-24-2008, 10:54 PM
  3. my upcoming UNO card game :)
    By Hussain Hani in forum Game Programming
    Replies: 5
    Last Post: 01-24-2008, 01:19 AM
  4. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM