Тема: Як "Правильно" створити рандом
Всім привіт , потрібен код який видає рандомні імена
в мене в деякому сенсі майже вийшло
public static void Main(string[] args)
{
Random randNme = new Random();
int _who = randNme.Next(1, 40);
string[] MenName = new string[94];
#region Men_Name
MenName[0] = "Олександр";
MenName[1] = "Анатолій";
MenName[2] = "Андрій";
MenName[3] = "Антон";
MenName[4] = "Аркадій";
MenName[5] = "Арсеній";
MenName[7] = "Артем";
MenName[8] = "Артур";
MenName[9] = "Афанасій";
MenName[10] = "Бенедикт";
MenName[11] = "Богдан";
MenName[12] = "Борис";
MenName[13] = "Вадим";
MenName[14] = "Валерій";
MenName[15] = "Василь";
MenName[16] = "Віктор";
MenName[17] = "Віталій";
MenName[18] = "Володимир";
MenName[19] = "Владислав";
MenName[20] = "Всеволод";
MenName[21] = "В'ячеслав";
MenName[22] = "Генадій";
MenName[23] = "Георгій";
MenName[24] = "Герасим";
MenName[25] = "Давид";
MenName[26] = "Данило";
MenName[27] = "Денис";
MenName[28] = "Дмитро";
MenName[29] = "Євген";
MenName[29] = "Єгор";
MenName[30] = "Захар";
MenName[31] = "Іван";
MenName[32] = "Ігор";
MenName[33] = "Ілля";
MenName[34] = "Йосип";
MenName[35] = "Кирило";
MenName[36] = "Костянтин";
MenName[37] = "Лев";
MenName[38] = "Леонід";
MenName[39] = "Любомир";
MenName[40] = "Макар";
MenName[41] = "Максим";
MenName[42] = "Матвій";
MenName[43] = "Мирослав";
MenName[44] = "Михайло";
MenName[45] = "Нікіфор";
MenName[46] = "Микола";
MenName[47] = "Олег";
MenName[48] = "Осип";
MenName[49] = "Остап";
MenName[50] = "Павло";
MenName[51] = "Петро";
MenName[52] = "Прохор";
MenName[53] = "Родіон";
MenName[54] = "Роман";
MenName[55] = "Ростислав";
MenName[56] = "Руслан";
MenName[57] = "Святослав";
MenName[58] = "Семен";
MenName[59] = "Сергій";
MenName[60] = "Станіслав";
MenName[61] = "Степан";
MenName[62] = "Тарас";
MenName[63] = "Устин";
MenName[64] = "Філіп";
MenName[65] = "Харитон";
MenName[66] = "Юрій";
MenName[67] = "Яків";
MenName[68] = "Ярослав";
MenName[69] = "Назар";
MenName[70] = "Анатолій";
MenName[71] = "Павло";
MenName[72] = "Артем";
MenName[73] = "Костянтин ";
MenName[74] = "Григорій";
MenName[75] = "Ігор";
MenName[76] = "Леонід";
MenName[77] = "Гліб";
MenName[78] = "Семен";
MenName[79] = "Борис";
MenName[80] = "Ростислав";
MenName[81] = "Ярослав";
MenName[82] = "Савелій";
MenName[83] = "Ілля";
MenName[84] = "Давид";
MenName[85] = "Рустам";
MenName[86] = "Богдан";
MenName[87] = "Артур";
MenName[88] = "Олег";
MenName[89] = "Василь";
MenName[90] = "Юрій";
MenName[91] = "Віктор";
MenName[92] = "Роман";
MenName[93] = "Іван";
String Name_Men = (MenName[randNme.Next(0, 93)]);
#endregion
string[] WomenName = new string[45];
#region Woman_Name
WomenName[0] = "Вероніка";
WomenName[1] = "Кароліна";
WomenName[2] = "Анастасія";
WomenName[3] = "Любов";
WomenName[4] = "Віталіна";
WomenName[5] = "Оксана";
WomenName[7] = "Єлизавета";
WomenName[8] = "Сніжана";
WomenName[9] = "Лариса";
WomenName[10] = "Ірина";
WomenName[11] = "Наталя";
WomenName[12] = "Галина";
WomenName[13] = "Ніна";
WomenName[14] = "Аліна";
WomenName[15] = "Майя";
WomenName[16] = "Дана";
WomenName[17] = "Олеся";
WomenName[18] = "Ганна";
WomenName[19] = "Злата";
WomenName[20] = "Лілія";
WomenName[21] = "Тамара";
WomenName[22] = "Варвара";
WomenName[23] = "Марія";
WomenName[24] = "Аліса";
WomenName[25] = "Катерина";
WomenName[26] = "Мар'яна";
WomenName[27] = "Ольга";
WomenName[28] = "Василіна";
WomenName[29] = "Ліза";
WomenName[29] = "Василіна";
WomenName[30] = "Ульяна";
WomenName[31] = "Карина";
WomenName[32] = "Софія";
WomenName[33] = "Марина";
WomenName[34] = "Раїса";
WomenName[35] = "Мирослава";
WomenName[36] = "Зінаїда";
WomenName[37] = "Олена";
WomenName[38] = "Ірина";
WomenName[39] = "Юліана";
WomenName[40] = "Алла";
WomenName[41] = "Даріна";
WomenName[42] = "Світлана";
WomenName[43] = "Юлія";
WomenName[44] = "Валентина";
String Name_Women = (WomenName[randNme.Next(0, 44)]);
#endregion
string[] Famely = new string[65];
#region Woman_Name
Famely[0] = "Шевченко";
Famely[1] = "Мельниченко";
Famely[2] = "Коваленко";
Famely[3] = "Бондаренко";
Famely[4] = "Ткаченко";
Famely[5] = "Бойко";
Famely[7] = "Кравченко";
Famely[8] = "Ковальчук";
Famely[9] = "Коваль";
Famely[10] = "Олійник";
Famely[11] = "Поліщук";
Famely[12] = "Савченко";
Famely[13] = "Лисенко";
Famely[14] = "Марченко";
Famely[15] = "Руденко";
Famely[16] = "Мороз";
Famely[17] = "Ткачук";
Famely[19] = "Бондар";
Famely[20] = "Петренко";
Famely[21] = "Ковальов";
Famely[22] = "Павленко";
Famely[23] = "Клименко";
Famely[24] = "Кузьменко";
Famely[25] = "Кравчук";
Famely[26] = "Пономаренко";
Famely[27] = "Василенко";
Famely[28] = "Харченко";
Famely[29] = "Гаврилюк";
Famely[29] = "Левченко";
Famely[30] = "Сидоренко";
Famely[31] = "Карпенко";
Famely[32] = "Швець";
Famely[33] = "Панченко";
Famely[34] = "Хоменко";
Famely[35] = "Юрченко";
Famely[36] = "Мельничук";
Famely[37] = "Мазур";
Famely[38] = "Романюк";
Famely[39] = "Павлюк";
Famely[40] = "Костенко";
Famely[41] = "Гончаренко";
Famely[42] = "Попович";
Famely[43] = "Романенко";
Famely[44] = "Мартинюк";
Famely[45] = "Назаренко";
Famely[46] = "Костюк";
Famely[47] = "Ткач";
Famely[48] = "Яковенко";
Famely[49] = "Колесник";
Famely[49] = "Семенюк";
Famely[50] = "Кравець";
Famely[51] = "Федоренко";
Famely[52] = "Терещенко";
Famely[53] = "Нестеренко";
Famely[54] = "Тарасенко";
Famely[55] = "Зінченко";
Famely[56] = "Макаренко";
Famely[57] = "Демченко";
Famely[58] = "Бабенко";
Famely[59] = "Білоус";
Famely[60] = "Іщенко";
Famely[61] = "Яченко";
Famely[62] = "Міщенко";
Famely[63] = "Тищенко";
Famely[64] = "Коваль";
String _Famely = (Famely[_who]);
#endregion
List<People> people = new List<People>();
people.Add(new Man(Name_Men, _Famely, Name_Men, Name_Men));
List<People> _people = new List<People>();
_people.Add(new Woman(Name_Women, _Famely, Name_Men, Name_Men));
string Who;
int how;
Console.WriteLine("Кто нужен ? : ");
Who = Console.ReadLine();
Console.WriteLine("Сколько нужно ? : ");
how = Convert.ToInt32(Console.ReadLine());
switch (Who)
{
case "Men":
for (int Xmen = 0; Xmen < how; Xmen++)
{
if (Xmen < how)
foreach (People _People in people)
{
Console.WriteLine(_People.Name);
Console.WriteLine(_People.Famely);
Console.WriteLine(_People.Email);
//_People.Appium();
}
}
break;
case "Women":
for(int xWomen = 0; xWomen < how; xWomen++)
{
if (xWomen < how)
foreach (People __People in _people)
{
Console.WriteLine(__People.Name);
Console.WriteLine(__People.Famely);
Console.WriteLine(__People.Email);
// __People.Appium();
}
}
break;
case "WM":
for (int xWM = 0; xWM < how; xWM++)
if (xWM < how)
{
Console.WriteLine("Мужик");
Console.WriteLine("Девушка");
}
break;
default:
Console.WriteLine("Что то пошло не так");
break;
}
Але завжди видає одне й те саме ім"я , як правильно прописать , чи хоч б що використати , щоб імена були завдли рандомні