⽹络游戏随机取名
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RandomName
{
class Program
{/// <summary>
/// 随机取名
/
// </summary>
/// <param name="count">获取的随机名字数量获取⼀条输⼊1</param>
/// <returns></returns>
public static List<string>GetNames(int count)
{//From:www.uzhanbao
Random ran =new Random();
List<string> s =new List<string>{};
string[] nameS3 =new string[]{"樱桃","椰⼦","西柚","猕猴桃","柠檬","龙眼","荔枝","芒果","⼭⽵","橘⼦","橄榄","桃","李⼦","哈密⽠","甜⽠","⽊⽠","蜜⽠","菠萝","⽢蔗","树莓","苹果","梨梨","杏","桃桃","⾹蕉","菠萝","西⽠","橙橙","柠檬","芒果","蓝莓","枇杷果","桑椹","油桃"};
string[] nameS1 =new string[]{"⼤⼤","红彤彤","亮亮","⾹⾹","稳稳","开朗","害羞","活泼","热情","笑呵呵","萌","⼤不了","急性⼦","忙忙叨叨","稀⾥糊涂","⼩⼩","温柔","内向","腼腆","害羞","直率","活泼","开
朗","滑稽","可笑","古怪","怪异","宽容","多情","冷淡","热情","拘谨","谨慎","严格","严厉","⽆情","⽆赖","脏脏","飘逸","圣洁","纯洁","清纯","可爱","贤慧","慈爱","仁慈","⽼实","⽊讷","慷慨","⼤⽅","随性","暴躁","急躁","骄傲","⼤⽓","侠义","忠诚"};
string[] nameS2 =new string[]{"⼩","帅","软","傻","狂","乖","萌","呆","和","甜"};
#region成语
/*
"春暖花开","
⼗字路⼝","
千军万马","
⽩⼿起家","
张灯结彩","
风和⽇丽","
万⾥长城","
⼈来⼈往","
⾃由⾃在","
⽠⽥李下","
助⼈为乐","
红男绿⼥","
网络游戏霸气名字春风化⾬","
马到成功","
拔苗助长","
安居乐业","
⾛马观花","
念念不忘","落花流⽔","⼀往⽆前","落地⽣根","天罗地⽹","东⼭再起","⼀事⽆成","⼭清⽔秀","语重⼼长","别有洞天","⽔深⽕热","鸟语花⾹","⾃以为是","百花齐放","⼀五⼀⼗","⼗全⼗美","坐井观天","青⼭绿⽔","天⽹恢恢","诗情画意","⼀⼼⼀意","先⼊为主","和风细⾬","⼗指连⼼","五花⼋门","炎黄⼦孙","成家⽴业","不由⾃主","万⽔千⼭","⼀⾔为定","莺歌燕舞","顶天⽴地","风平浪静","安⾝⽴命","乐极⽣悲","⾯红⽿⾚","热⽕朝天","百发百中","井井有条","⼀路平安","
⼀路平安","
⾯⽬全⾮","
三⼼⼆意","
旁若⽆⼈","
回天⽆⼒","
三更半夜","
取长补短","
⼀团和⽓","
满⾯春风","
窗明⼏净","
桃红柳绿","
⽬中⽆⼈","
古往今来","
美中不⾜","
狗急跳墙","
头头是道","
⼀表⼈才","
⽔秀⼭明","
⼼直⼝快","
舍⼰为⼈","
张三李四","
深情厚谊","
⽕烧眉⽑","
古今中外","
贪⽣怕死","
长年累⽉","
⽑⼿⽑脚","
星星点点","
答⾮所问","
⾮亲⾮故","
⽩天做梦","
你追我赶","
千⼈⼀⾯","
骑马马
*/
#endregion
for(int i =0; i < count; i++)
{
string s1 = nameS1[ran.Next(0, nameS1.Length -1)];
string s2 = nameS2[ran.Next(0, nameS2.Length -1)];
string s2 = nameS2[ran.Next(0, nameS2.Length -1)];
string s3 = nameS3[ran.Next(0, nameS3.Length -1)];
string name = s1 + s2 + s3;
if(!s.Contains(name))
{
s.Add(name);
}
else
{
i--;
}
}
return s;
}
static void Main(string[] args)
{
foreach(var ss in GetNames(1000))
{
Console.WriteLine(ss);
}
Console.ReadKey();
}
}
}