Enumerations | Functions | Variables
randname.h File Reference

Random name generation. More...

Go to the source code of this file.


 The different types of name randname.c can generate which is also the number of sections in names.txt. More...


size_t randname_make (randname_type name_type, size_t min, size_t max, char *word_buf, size_t buflen, const char ***wordlist)
 Make a random name.


const char *** name_sections
 Array[RANDNAME_NUM_TYPES][num_names] of random names.

Detailed Description

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.

Enumeration Type Documentation

The different types of name randname.c can generate which is also the number of sections in names.txt.


Function Documentation

size_t randname_make ( randname_type  name_type,
size_t  min,
size_t  max,
char *  word_buf,
size_t  buflen,
const char ***  sections 

Make a random name.

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).

References build_prob(), E_WORD, FALSE, I2A, is_a_vowel(), randint0, RANDNAME_NUM_TYPES, S_WORD, TOTAL, TRUE, and void().

Referenced by artifact_gen_name(), flavor_init(), and get_name_keypress().

Variable Documentation

const char*** name_sections

Array[RANDNAME_NUM_TYPES][num_names] of random names.

Referenced by cleanup_names(), finish_parse_names(), flavor_init(), get_name_keypress(), and init_names().