Ejemplo n.º 1
0
    public static string generateWord(int length)
    {
        Game.threadDangerSB.Clear();
        if (Game.random.Next(10) == 1)
        {
            Game.threadDangerSB.Append(vowels.getRandom());
            if (Game.random.Next(2) == 1)
            {
                Game.threadDangerSB.Append(consonants.getRandom());
            }
        }
        //if (Game.random.Next(6) == 1)
        //    Game.threadDangerSB.Append(consonants.getRandom());

        for (int i = 0; i < length; i += 2)
        {
            Game.threadDangerSB.Append(consonants.getRandom()).Append(vowels.getRandom());
            if (Game.random.Next(5) == 1 || length == 2)
            {
                Game.threadDangerSB.Append(consonants.getRandom());
            }
        }
        return(UtilsMy.FirstLetterToUpper(Game.threadDangerSB.ToString()));
    }
Ejemplo n.º 2
0
    public string generateProvinceName()
    {
        result.Clear();
        result.Append(prefix.getRandom());
        if (Game.random.Next(3) == 1)
        {
            result.Append(generateWord(Game.random.Next(2, 5)));
        }
        else
        {
            result.Append(generateWord(Game.random.Next(3, 5)));
        }
        result.Append(postfix.getRandom());

        return(result.ToString());
    }