public static int Num()
{
char[] arr = { '0', '1', '2', '3' };
Random ran = new Random();
int score = 0;
try
{
int num = ran.Next(4);
Console.WriteLine("亲,请输入您要猜的数字哦~别忘了按回车哦~");
//Console.Write(arr[num]); // 打印要猜的数字
int a = int.Parse(Console.ReadLine());
if (num == a)
{
score = 10;
Console.WriteLine("√ 亲~恭喜您猜对了哦~");
}
else
Console.WriteLine("× 亲~很遗憾您猜错了哦~");
}
catch
{
Console.SetCursorPosition(10, Console.CursorTop - 1);
Console.WriteLine("× 亲~很遗憾您猜错了哦~");
}
return score;
}
贴吧排版太蛋疼了= =不知道发出来是什么样子的