#!/usr/bin/perl

use strict;
use warnings;
	
my $random_state = 0;

sub lcg_srand {
    $random_state = shift;
}


sub libc_rand{
    use integer;
    $random_state = (1103515245 * $random_state + 12345);
}

sub lcg_rand {
    my $top = shift || 1.0;
    lcg_srand(0) unless defined $random_state;
    return $top * (libc_rand() / (2**31));
}


my @r = map {libc_rand()}(1..64);

foreach my $s (0..6){
    printf "\n%2d  ", 1<< $s;
    foreach (@r){
        print $_ & 1<<$s ? 'x' : ' ';
    }
}
print "\n";
