Game of Life

This is a discussion on Game of Life within the Contests Board forums, part of the Community Boards category; Um ... no. If you do this is straight assembly, your biggest problem is probably the syntax difference. You'd have ...

  1. #16
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Um ... no.

    If you do this is straight assembly, your biggest problem is probably the syntax difference. You'd have to code with gas on Win32 while testing.

    But if you code to pthreads, there are pthreads implementation on top of Win32.

    As for the GPU, well, good luck. OpenGL is cross-platform, so it might work. I'll have to look up my exact GPUs though.
    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

  2. #17
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Any reason why you want AT&T syntax? I was unde the impression that gcc uses intel syntax for inline assembly.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  3. #18
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Quote Originally Posted by abachler View Post
    Any reason why you want AT&T syntax? I was unde the impression that gcc uses intel syntax for inline assembly.
    AFAIK, gcc only supports AT&T syntax.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  4. #19
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by abachler View Post
    Any reason why you want AT&T syntax? I was unde the impression that gcc uses intel syntax for inline assembly.
    GCC uses whatever syntax the assembler wants.

  5. #20
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    If your build system can convince gas to use Intel syntax, you're welcome to use it. I don't think it really supports 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. #21
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Aparrently, .intel_syntax is an undocumented directive that is supported in versions 2.10 and later in gas.

    http://www.osdev.org/wiki/GAS
    http://www.google.com/search?q=.intel_syntax+gas
    Last edited by robwhit; 01-25-2008 at 11:52 AM.

  7. #22
    Registered User
    Join Date
    Jan 2008
    Posts
    287
    Do we have to display the grid every generation, or just display the final generation?

  8. #23
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Only the final result is of interest. Otherwise, the contest would be about I/O speed.
    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

  9. #24
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Well, considering the expertise of others here who will enter I don't think my entry has a shot of winning, but I plan to enter it just the same (it's actually completed, but I want to tinker with it a bit and make it "pretty", add some bells and whistles and whatnot). I don't know enough about Assembly to get under the hood and tinker with my compiler's output effectively.

    Your comment
    Quote Originally Posted by CornedBee
    However, I will give out bonus points for solutions that do not use fixed-size grids. I'll just have to think of a fair and balanced way of adding that in.
    got me thinking, and I plan to make my entry capable of simulating a board with millions of live cells without requiring gigabytes of memory.

    I am just wondering when you will post some test input/output files for us to tinker with. I'm pretty confident that my implementation is working properly, but it would be nice validation to run an input file and have my program produce the correct output for x generations. Thus far I've done that by hand with relatively small test patterns, but I'd love to throw a puffer train at it and have the output match a couple thousand generations of simulation.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  10. #25
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    You're right. Here are the reference files in steps of 500.
    Attached Files Attached Files
    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. #26
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    And the last two.
    Attached Files Attached Files
    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

  12. #27
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Woo hoo! My ouput matches at each stage, and it took only 15 seconds (counted outloud with "one thousand one, one thousand two" method) to run 3000 generations. =o)

    Now I can figure out which bells and whistles I'm going to attach.

    Thanks, CornedBee! Also, did you generate these or get them from somewhere? I did searches on Google but only ever found starting patterns.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  13. #28
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by CornedBee View Post
    Implementations based on hashlife are forbidden, sorry. This advanced algorithm is so superior that it would be pointless to compare it against the other possibilities.
    Does this mean that any 2D pattern matching over time is out?

    How close are we talking about "based on" here?

  14. #29
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Also, did you generate these or get them from somewhere?
    These were supplied by the university. But they generated them themselves.

    Does this mean that any 2D pattern matching over time is out?
    The basic algorithm of hashlife is to identify larger patterns and predict their development. This is forbidden.
    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

  15. #30
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274

    Still working?

    I hope people are still working on this.

Page 2 of 5 FirstFirst 12345 LastLast
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, 02: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, 01:48 AM
  3. C Programming 2d Array Question
    By jeev2005 in forum C Programming
    Replies: 3
    Last Post: 04-26-2006, 04:18 PM
  4. Game Of Life
    By din1983 in forum C Programming
    Replies: 20
    Last Post: 10-11-2005, 11:36 PM
  5. Please help with some coding..
    By stehigs321 in forum C Programming
    Replies: 2
    Last Post: 10-27-2003, 06:44 PM

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