dthacker has asked for the wisdom of the Perl Monks concerning the following question:
I'm not lazy enough. Consider the following case. I'm working on a soccer simulation that assigns players a score for each of 4 attributes. For example midfielders will have a passing attribute between 6 and 21 , shooting attribute between 6 and 12, and so on. I want to tweak the distribution
to a "bell shaped curve" so that most of the players are assigned a score in the midpoint of the range, and fewer are assigned a high or low score. My solution was to create a file with 100 values like this:
Dave
Code On!
- lines with score of 6 3
- score of 7 5
- score of 8 6
- ...
- score of 12 13
- ...
- score of 21 2
There must be an easier and more perlish way to do this, but I'm having trouble visualizing a data structure that would do it. Any suggestions?
Dave
Code On!
Edit by BazB, fix sig div tag.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Efficient ways of storing a data set for random access
by Zaxo (Archbishop) on Jan 29, 2004 at 03:45 UTC | |
Re: Efficient ways of storing a data set for random access
by l3nz (Friar) on Jan 29, 2004 at 12:35 UTC | |
Re: Efficient ways of storing a data set for random access
by Roy Johnson (Monsignor) on Jan 29, 2004 at 16:19 UTC |
Back to
Seekers of Perl Wisdom