The first 3 scalars are default values. If they are not declared differently in the array, then they don't change. If they are declared in the array, then they change to the new value.

Also, all variables have to be as small as possible. I try to conserve space as much as possible, hence the one and two letter variable names.

In the array, the name of the monster will be chosen randomly, but the other information such as which book it comes from and what page it is on must be declared, hopefully, within the array. If I have to do separate hashes(?) for each value, it will be way to big. Other random generators with similar variables have up to 10 different variables changed all on one line.

Hopefully that made sense.

There is a random generation program that I use for what I am trying to recreate in Perl called TableSmith. If you know of it, that will show you where I am coming from.


In reply to Re^3: Creating a random generator by Lady_Aleena
in thread Creating a random generator by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.