|laziness, impatience, and hubris
Creating a random generatorby Lady_Aleena (Priest)
|on Sep 06, 2007 at 13:36 UTC
Lady_Aleena has asked for the wisdom of the Perl Monks concerning the following question:
Please bear with the as I am a complete novice in programming languages. The only languages that I know are HTML and CSS.
I would like to create a random generator for my website based on several charts, so that the users of my site will not have to manually roll for the results (manually meaning getting out a their dice).
Could someone please help me by showing me a basic generator, such as maybe how to randomly select a color (red, yellow, green, cyan, blue, magenta, white, gray, black)? From there, hopefully, it may be easier for me to understand how this language works.
Any help would be appreciated.
From the tutorials and replies below; here is a sample of some arrays that I have created for randomization.
This is only the beginning, some parts of the random generator that I would like to create are extremely complex, and these are just a small part of it. I just hope that I got it right so far.
Learned a very valuable lesson, the order in which the arrays was listed is important. Also, qw only works on single word items, it doesn't seem to work on phrases. I may be wrong on that, but I will keep researching it. Updated the code above. So far, it works!