Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Powerball mania!

by ckohl1 (Hermit)
on Aug 24, 2001 at 23:51 UTC ( [id://107682]=note: print w/replies, xml ) Need Help??


in reply to Powerball mania!

At this point, I think that many programmers are working on the same project...
#!f:/perl/bin/perl.exe -w use strict; my $PowerballHistoricFile='d:/code/perl/lottery/powerball_numbers.txt' +; my(%History,$Date,@Numbers); open(HISTORY,$PowerballHistoricFile) or die "Could not open $Powerball +HistoricFile!"; foreach my $Line(<HISTORY>){ ($Date,@Numbers)=split(/ /,$Line); $History{$Date}=[@Numbers]; } close(HISTORY); my(%Frequency,%Frequency2); foreach my $Key(sort(keys(%History))){ for my $SubCounter(0..4){ $Frequency{$History{$Key}[$SubCounter]}++; } } foreach my $Key(sort(keys(%Frequency))){ if($Frequency2{$Frequency{$Key}}){ $Frequency2{$Frequency{$Key}}.=", $Key"; } else { $Frequency2{$Frequency{$Key}}=$Key; } } print "Content-Type: text/html\n\n<html><body>\n"; print qq(<br><table border="1" cellpadding="2" cellspacing="0" align=" +center"><caption style="font-size: 15px; font-weight: bold;">Power Ba +ll Historic Information</caption>\n); print qq(<tr bgcolor="#dddddd"><th>Number of Drawings</th><th>Numbers< +/th></tr>\n); foreach my $Key(sort(keys(%Frequency2))){ print qq(<tr><td align="center">$Key</td><td>$Frequency2{$Key}</td +></tr>\n); } print qq(</table>\n</body></html>\n); exit;


Chris

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://107682]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found