Skip to content

Instantly share code, notes, and snippets.

@bradfitz bradfitz/blast.pl
Created Apr 16, 2012

Embed
What would you like to do?
Cognac Hacking
#!/usr/bin/perl
use strict;
my $rockettop = <<'END';
.
/ \
/ \
END
my $rocketmid = <<'END';
| X |
| |
END
my $rocketbot = <<'END';
/ | | | \
END
my @girls;
for my $line (split(/\n/, `curl -s http://www.census.gov/genealogy/names/dist.female.first`)) {
$line =~ s/\s.+//;
push @girls, $line;
}
while (1) {
my $girl = $girls[int(rand() * scalar(@girls))];
my $rocket = $rockettop;
for my $let (split(m//, $girl)) {
my $frag = $rocketmid;
$frag =~ s/X/$let/;
$rocket .= $frag;
}
$rocket .= $rocketbot;
my $indent = " " x int(rand() *30.0);
my @lines = split(/\n/, $rocket);
for my $l (@lines) {
print "$indent$l\n";
select undef, undef, undef, 0.05;
}
print "\n";
}
@dickhardt

This comment has been minimized.

Copy link

dickhardt commented Apr 16, 2012

Nice to see you are still hacking in Perl. I've moved onto nodejs. :)

@bradfitz

This comment has been minimized.

Copy link
Owner Author

bradfitz commented Apr 16, 2012

Barely. I write almost exclusively in Go these days. (that's my full-time job at Google, working on Go).

This was the first Perl I'd written in years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.