Thread: Game of Life

  1. #46
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Lol, thanks brewbuck. Got it working now, and it looks quite nice when run fast.

    http://i92.photobucket.com/albums/l1...Screenshot.png
    Its still slow, but i have a new version thats 7x faster plus theres still plenty of room for improvement so I guess I may make a serious entry after all.

  2. #47
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by CornedBee View Post
    I can analyze the usage, but I won't count it. My experience with our own program is that memory usage is its own speed penalty in CPU-bound applications. Basically, our performance went down drastically when the data got too large to fit into the L2 cache.
    Multithreaded solutions also lead to some interesting cache problems.

  3. #48
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    A few input patterns with interesting behavior. I transcribed these by hand from the images on the Wikipedia page. As I make more, I'll collect them and post them here. They are in the format expected by the contest, so you should be able to load them directly.

  4. #49
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Quote Originally Posted by CornedBee View Post
    And God help you if you start swapping.
    Heh, my first attempt worked, but watching it with Sysinternals' Process Explorer (and knowing what steps it was taking since I wrote it), it spent the first ~60 seconds waiting for malloc to return with a pointer to an ungodly amount of memory (while my HD thrashed and everything else on my machine decided to sit idly by and watch this trainwreck), and then another 20 seconds or so to run through 3,000 iterations...

    I guess using a few hundred megs of memory isn't such a good idea in this case.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  5. #50
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    One week left, people. If you want to submit, now's the time to do it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #51
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    I have submitted my entry, though it isn't exactly what I wanted it to be... Don't laugh too hard at it!
    Last edited by jEssYcAt; 04-15-2008 at 12:27 AM. Reason: stupid emoticons
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  7. #52
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    I'll be submitting tonight or tomorrow. I need to get a chance to do some code cleanup. It's working, though.

  8. #53
    abyss - deep C
    Join Date
    Oct 2007
    Posts
    46
    Hi,

    Once the contest ends, will you be posting the best code so that others could learn?

    cheers
    maverix

  9. #54
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Submissions are no longer being accepted. We will probably see all the entries. Give him time to evaluate them though.

  10. #55
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I'm quite busy right now, so it will take some time. But yeah, I can post the entries. I only received three anyway. (mike_g, jessycat and brewbuck)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  11. #56
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Woo hoo! I can't do worse than 3rd place then!
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  12. #57
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    I'm quite busy right now, so it will take some time. But yeah, I can post the entries. I only received three anyway. (mike_g, jessycat and brewbuck)
    Its late so its no problem if it dosent count but I attached my most recent version. I dident know my original counted, as it dident meet the criteria. W/o graphics I managed to get it 10x faster than my original. Sorry I never submitted it. Reasons being: I'm still not happy with it (there are more optimisations I could have made), and I never got around to adding the code to read from files and printf the output. I have been very busy lately

  13. #58
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Any idea when we might see some results?

    Just checking in -- no pressure.

  14. #59
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Quote Originally Posted by brewbuck View Post
    Any idea when we might see some results?

    Just checking in -- no pressure.
    He's probably waiting for my entry to finish 10 or 15 generations of a semaphore...
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  15. #60
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895


    No, actually I'm just way too busy with university stuff to get to the contest. Sorry, but it may be a while yet.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Open-source Game Project
    By Glorfindel in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 03-24-2009, 01:12 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, 12:48 AM
  3. C Programming 2d Array Question
    By jeev2005 in forum C Programming
    Replies: 3
    Last Post: 04-26-2006, 03:18 PM
  4. Game Of Life
    By din1983 in forum C Programming
    Replies: 20
    Last Post: 10-11-2005, 10:36 PM
  5. Please help with some coding..
    By stehigs321 in forum C Programming
    Replies: 2
    Last Post: 10-27-2003, 06:44 PM