Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

LFSR golf

by tye (Sage)
on May 08, 2001 at 01:23 UTC ( [id://78666] : perlmeditation . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    use strict;
    ...
    while( 1 ) {
        print join( " ", map $lfsr->(), 1..$bits ), $/;
    }
    
  2. or download this
    my $lfsr= golfGenLFSR( $nBits, $iSeed, $tap0, $tap1, $tap2 );
    my $nextBit= $lfsr->();