Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

High Performance Game of Life

by eyepopslikeamosquito (Chancellor)
on Aug 11, 2017 at 12:49 UTC ( #1197250=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    // Organism.h
    // Simple implementation of Conway game of life in standard C++11.
    ...
    };
    
    #endif /* ORGANISM_H */
    
  2. or download this
    // tbench1.cpp. Simple benchmark of Organism class.
    // g++ compile on Linux:
    ...
       RunTest(fname, nticks);
       return 0;
    }
    
  3. or download this
    package Organism;
    
    ...
    }
    
    1;
    
  4. or download this
    # tbench1.pl - Simple benchmark of Organism class.
    # Generate blinker test file with, for example:
    ...
    my $ncells = $org->count();
    print "cell count at end = $ncells\n";
    warn "time taken: $taken secs\n";
    
  5. or download this
    # Create blinker test data for load testing, e.g.:
    #   perl createblinker.pl 500000 -100000 10 >x.tmp 2>y.tmp
    ...
       blink( $x2, $y-1 );
       $x += $gap;
    }
    
  6. or download this
    # tgol2.t - Simple blinker test of Conway Game of Life Organism class
    # Generate file blinker.txt with:
    ...
       $org->tick();
       test_one( $org, "blinker $i", $i % 2 ? \@sblinker2 : \@sblinker1 );
    }
    
  7. or download this
    # tgol.t - Simple blinker test of Conway Game of Life Organism class
    use strict;
    ...
       $org->tick();
       test_one( $org, "blinker $i", $i % 2 ? \@sblinker2 : \@sblinker1 );
    }
    
  8. or download this
    # tbench1-infinite.pl - Simple benchmark.
    # Uses Game::Life::Infinite::Board
    ...
    my $ncells = $org->statistics->{'liveCells'};
    print "cell count at end = $ncells\n";
    warn "time taken: $taken secs\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://1197250]
Front-paged by Athanasius
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-07-22 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (453 votes). Check out past polls.

    Notices?