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.
LA
Update
From the tutorials and replies below; here is a sample of some arrays that I have created for randomization.
print "content-type: text/html \n\n"; @AbilityName = qw(strength dexterity constitution intelligence wisdom +charisma ); @Class = qw(Warrior Rogue Priest Wizard Psionisist); @WeapType = qw(bludgeoning piercing slashing missile); @WeapMat = qw(bone metal stone wooden); @NWPlearn = ( "$AbilityName[rand @AbilityName] based", "$Class[rand @Class] specific" ); @Mutation = ( "unable to learn $NWPlearn[rand @NWPlearn] non-weapon proficiencies", "unable to learn $WeapType[rand @WeapType] weapons", "can not use $WeapMat[rand @WeapMat] weapons" ); print "Character mutation: $Mutation[rand @Mutation]", "\n";
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.
Update 2
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!
In reply to Creating a random generator by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |