random类的使用

小栗子a如下:

string[] punch = new[]  { "石头", "剪刀", "" };
string myPunch;
public string MyPunch
    {
       get
         {
           Random random = new Random();
           int Index = random.Next(3);
           myPunch = punch[Index].ToString();
           return myPunch;
         }
    }

 

相关文章:

  • 2021-07-31
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2022-02-10
  • 2022-01-30
  • 2022-12-23
  • 2022-02-10
  • 2021-12-06
相关资源
相似解决方案