Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

High Performance Game of Life

by eyepopslikeamosquito (Archbishop)
on Aug 11, 2017 at 12:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1197250]
Front-paged by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-06-18 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.