[Freeciv-Dev] Re: city names (was: It's a game already!)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> Someone has an algorithm to randomly generate tolkein-esque names they wrote
> for some angband variant, IIRC -- maybe greg would remember...
Oh ... we had exactly this thing as a mandatory excersise when I was a
student. I think I should manage to dig out my own piece of code from my
old archives if anyone is interessted. It was written in C++ (but other
students did it in C and Pascal, and nowadays they probably do it in
Java - I might also ask if somebody have some nice C code to contribute if
you're interessted). I was rather proud of it back then, I don't know if
I'm equally proud today :)
A friend of mine used the engine as a tool for generating the kind of
local northern language which is not commonly accepted in the more
southern parts of Norway. That piece of code would certainly have been
banned in US and Australia if it had been translated. :)
The excersise specificated the algoritm in detail, as well as
some constraints on the data structure, but I found the excersise quite
fun anyway. Here's the algoritm, from my own memory:
Building the data structure:
- The variable n as well as an input text should be given runtime. The
input text should be trimmed so all whitespace appeared as one space.
- Each sequence of n characters (blank beeing treated as any other
character) should be stored.
- For each stored character sequence, there should be stored a frequency
count of the following character.
Generating random svada:
- Start with a random sequence.
- Pick a random following character, but weighted according to the
frequency count.
- Deal with text formatting and ending
Oh, I almost feel like making this once more, this time in perl....
--
Tobias Brox (alias TobiX) - +4722925871 - _urgent_ emails to
sms@xxxxxxxxxxxxxxxxxx. Check our upcoming MMORPG at
http://www.anarchy-online.com/ (Qt) and play multiplayer Spades,
Backgammon, Poker etc for free at http://www.funcom.com/ (Java)
- [Freeciv-Dev] Re: It's a game already!, (continued)
- [Freeciv-Dev] Re: It's a game already!, paulz, 2000/02/15
- [Freeciv-Dev] Re: It's a game already!, Tomasz Wegrzanowski, 2000/02/15
- [Freeciv-Dev] Re: It's a game already!, Dan Ward, 2000/02/16
- [Freeciv-Dev] Re: It's a game already!, Reinier Post, 2000/02/16
- [Freeciv-Dev] Re: It's a game already!, Stephen Hodge, 2000/02/17
- [Freeciv-Dev] city names (was: It's a game already!), Reinier Post, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!), Jules Bean, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!),
Tobias Brox <=
- [Freeciv-Dev] Re: city names (was: It's a game already!), Reinier Post, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!), Robert Brady, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!), Jules Bean, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!), Reinier Post, 2000/02/17
- [Freeciv-Dev] Re: city names (was: It's a game already!), Falk Hueffner, 2000/02/17
- [Freeciv-Dev] algorithm to generate city names (was: city names (was: It's a game already!)), Reinier Post, 2000/02/18
[Freeciv-Dev] Re: It's a game already!, Jason Todd, 2000/02/18
|
|