dcsimg
Results 1 to 10 of 10

Thread: Conway's Game Of Life cellular automaton

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Conway's Game Of Life cellular automaton

    Hey,

    Here's a quick project I made while bored.

    It's about the cellular automaton often called Conway's Game Of Life:
    http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life


    I thought it could be useful for people so decided to clean it up a bit and post it. I added support for:
    - Different grid sizes
    - Different cell sizes (set during design-time)
    - Loading and saving grids
    - Playing / Pausing
    - Stopping, which resets the grid back to how it was before you pressed Play.

    Screenshot:


    While not running, you can paint cells that are alive by using the left mouse button, and you can 'kill' cells using the right mouse button.
    To change the speed of the 'simulation', just change the Interval property on the timer.


    The code should be very easy to follow (there's not much of it), but if you have any questions don't hesitate to ask
    Attached Files Attached Files

  2. #2
    Lively Member OTO's Avatar
    Join Date
    Jan 2010
    Location
    Washington State
    Posts
    96

    Re: Conway's Game Of Life cellular automaton

    How can i run this program?

  3. #3

  4. #4
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: Conway's Game Of Life cellular automaton

    What version is this? I tried opening it in vb 2005, says it's a newer version.

  5. #5

  6. #6
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Conway's Game Of Life cellular automaton

    Gliders turn into blocks when they hit the wall of the grid. That's not supposed to happen...

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Conway's Game Of Life cellular automaton

    Oh, I dunno sorry

    Not quite sure how I implemented the edges, but I think I simply return a new (and thus, dead) cell when the x or y value is outside the range of the grid. How would I implement it differently, and how do the gliders need to behave then?

  8. #8
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Conway's Game Of Life cellular automaton

    If the glider is unobstructed it will continue forever, so I guess you will have to simulate it going off the grid and then disappearing.

  9. #9
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: Conway's Game Of Life cellular automaton

    that said one of the things with the game of life is adding new rules, i was looking at an example of life which used LINQ, this author had a rule where cells would die when they got over a certain age. I kinda like the idea of cells living forever on the boundary, kinda like a safe haven, a warm bit or something it would work well if an age rule was used as well. then you could say introduce obstacles in the map which would do the same (or kill them if a diff colour?) lots of fun an good to see Life on this forum

    EDIT: just for completeness here is the article i was looking at, it is in C# though but the theory is the same

    http://www.codeproject.com/KB/linq/l...63#xx3378963xx
    Last edited by Megalith; Mar 25th, 2010 at 08:28 AM.
    If debugging is the process of removing bugs, then programming must be the process of putting them in.

  10. #10
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: Conway's Game Of Life cellular automaton

    Interesting, I like messing around with GOL programs. I noticed one bug however, clicking cancel in the input dialog still returns a "Enter a valid col/row" message even though I canceled.

    It also does not seem to like a larger grid. I tried with 300 cols/rows and it didn't run properly.

    Regardless, thanks for helping me kill a few minutes at work lol.
    Where I'm from we only have one bit of advice for new comers: "If you hear banjos, turn and run".


    VS 2008 .NetFW 2.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width