SPUG: Lottery Analyzer
Michael
digigasm at sdf.lonestar.org
Mon Feb 18 21:19:10 CST 2002
Hello,
I am trying to write a little lotto analyzer, just for self-indulgence.
I'm not really trying to win Lotto, but just using it as an interesting
excuse to increase my perl exposure. If I win, bonus!
Here's what I have so far:
A text file containing WA Lotto results back to 1999. Each line in the
file contains date (MMM-DD-YYYY) followed by whitespace followed by first
picked number followed by whitespace follwed by second picked number, etc.
Example:
Jan-16-1999 12 14 16 33 35 45
Jan-13-1999 2 25 32 35 41 45
Jan-09-1999 3 10 11 12 19 35
Jan-06-1999 19 24 32 37 41 42
Jan-02-1999 3 8 20 36 38 39
Here's the code I have so far:
##!/usr/bin/perl -w
#open(DATA, "< lottery.txt");
#
#while (<DATA>) {
#chomp;
#s/\s+/:/g;
#@line=split(':', $_);
## print "$line[0]\n";
#print "@line\n";
## $line{$line[0]}=$line[1..6];
#}
#close(DATA);
----------------------------------
I'm looking more for help with techniques and references rather than just
code examples but I'll appreciate any advice/help offered.
I want to start by finding the most often occurring numbers, but I'm
pretty new to programming, and don't really know how to go about doing it.
I suspect I'll need to use a hash or two, but I don't know where to start.
After finding the most often occurring numbers, I'll probably want to look
into the numbers between the numbers. Finding things like the average
span between numbers; stuff like that.
Can any of you offer advice on the data structures I'll need to work with?
If I win, I'll give SPUG a million :) I'd really only be able to handle
1-2 million by myself.
digigasm at freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list