Skip to main content
gamedev.net
🔒 Locked

Random Name Generator

Started by ThermoFish Jan 10, 2003 at 1:02 PM 7 replies 3.8k views
Original Post
ThermoFish
ThermoFish
Anyone ever written a random name generator in C++? Or does anyone have a link to a decent one? Preferably a single function returning a string. Thanks in advance.
stodge
stodge
I haven''t written one, but you could create several tables, each containing strings. Then to create a name, pick a random string from each table and put them together and see what you get.

Have you tried Google?
---------------------http://www.stodge.net
Losec
Losec
they are probably quite easy to write create several arrays storing name strings, then use rand() to pick an array entry
krez
krez
there is the Everchanging Book of Names, which is a stand-alone program for name generation. i don''t think the guy made the source code available, but the website and the docs that come with the program explain how it works.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Zipster
Zipster
You might want to work on a system that recognizes different letter patterns. For example, names that start with a vowel, and then there''s a constanant, etc. At the same, you contain some sort of database that stores information regarding how different letters sound together, how they flow, which letters work good together, and so on.
krez
krez
quote:
Original post by Zipster
You might want to work on a system that recognizes different letter patterns. For example, names that start with a vowel, and then there''s a constanant, etc. At the same, you contain some sort of database that stores information regarding how different letters sound together, how they flow, which letters work good together, and so on.

this is explained in more detail at the link i posted... it goes as far as loading a list of names (you can create if you like), and finding the common patterns in those names. so, if you type enough names from the same language, it will come up with appropriate new ones.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Dak Lozar
Dak Lozar

Link to a Flipcode tutorial:
http://www.flipcode.com/tutorials/tut_gennames.shtml

Dave "Dak Lozar" Loeser
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.