Random name generation. More...
|typedef unsigned short||name_probs [S_WORD+1][S_WORD+1][TOTAL+1]|
|static void||build_prob (name_probs probs, const char **learn)|
|This function builds probability tables from a list of purely alphabetical lower-case words, and puts them into the supplied name_probs object. More...|
|size_t||randname_make (randname_type name_type, size_t min, size_t max, char *word_buf, size_t buflen, const char ***sections)|
|Use W. More...|
|const char ***||name_sections|
|Array[RANDNAME_NUM_TYPES][num_names] of random names. More...|
Random name generation.
Copyright (c) 2007 Antony Sidwell, Sheldon Simms
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
This function builds probability tables from a list of purely alphabetical lower-case words, and puts them into the supplied name_probs object.
The array of names should have a NULL entry at the end of the list. It relies on the ASCII character set (through use of A2I).
Referenced by randname_make().
|const char ***||sections|
Make a random name.
Sheldon Simms' random name generator algorithm (Markov Chain stylee).
Generate a random word using the probability tables we built earlier. Relies on the A2I and I2A macros (and so the ASCII character set) and is_a_vowel (so the basic 5 English vowels).