Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
#!/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";

In reply to Powerball Frequency Analyzer by chromatic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found