Hello im a noob to this forum but anywho...
Im making a random word generator for my made up language (aka Conlang) called Ceenera and have gotten to the point where i want the user to be able to choose a range of syllables for the resultant words, as well as the "nominal" number of syllables to use, so that its more likely that a word will be closer to the nominal number of syllables than the bounds. ie. the user inputs via a form:
min: 1 syllable
nom: 2 syllables
max: 5 syllables
num of words: 1000
the results might be something like:
101 words with 1 syllable
499 words with 2 syllables
210 words with 3 syllables
139 words with 4 syllables
51 words with 5 syllables
The problem is, rand() and mt_rand() allow you to specify a range, but everything in that range is equally probable to be chosen. If anyones ever made a script like this before it would be much appreciated!
viel dank!
Weighted Random Numbers
Moderator: General Moderators
-
burzvingion
- Forum Newbie
- Posts: 11
- Joined: Sun Apr 18, 2004 2:30 pm
ty
ok thanksmuch! i think that'll work