#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my (@numbers, %normals, %powers);
my $content;
unless (defined ($content = get('http://www.powerball.com/results/pbhi
+st.txt'))) {
die "Cannot get PB history.\n";
}
@numbers = split /\n/, $content;
my @data;
foreach my $line (@numbers) {
next if ($line =~ /^!/);
@data = split(/\s/, $line);
shift @data; # throw away the date
$powers{pop @data}++;
foreach (@data) {
$normals{$_}++;
}
}
print "Normal Pick Rate:\n\n";
my @norm_sort = sort { $normals{$a} <=> $normals{$b} } keys %normals;
foreach (@norm_sort) {
print "$_ :\t($normals{$_})\t", "*" x $normals{$_}, "\n";
}
print "\nPower Pick Rate:\n\n";
my @power_sort = sort { $powers{$a} <=> $powers{$b} } keys %powers;
foreach (@power_sort) {
print "$_ :\t($powers{$_})\t", "*" x $powers{$_}, "\n";
}
print "\nNormal Picks:\t";
print join(" ", sort (@norm_sort[0 .. 11])), "\n";
print "\nPower Picks:\t";
print join(" ", sort (@power_sort[0 .. 3])), "\n";
print "\nDisclaimer:\n\tThis is not statistically accurate, except in
+that the drawings are
guaranteed.\nThis is just a quick frequency analysis making no pretens
+es as to predictive
accuracy.\n";
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|