作者reptile0426 ( )
看板C_Sharp
标题Re: [问题] 棍 快被搞疯了 Random问题
时间Sun Jun 24 03:05:09 2007
补上程式码
class test1
{
public int [] index;
public test1()
{
index = new int[6];
Random r = new Random(unchecked((int)DateTime.Now.Ticks));
for (int i = 0; i < index.Length; i++)
index[i] = r.Next(1000000000) % 2;
//index[i] = r.Next(2);
}
}
static void Main(string[] args)
{
test1 xxxxx = new test1();
test1 xxx = new test1();
test1 xxxx = new test1();
}
}
我只要乱数取 0 OR 1
取出来index[]的RANDOM数 都一样 大家帮帮忙吧
注解哪一行也一样
--
落地生根手创坊
http://www.wretch.cc/album/switch1001
手工精品~~~欢迎参观指教!!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.25.101.28
※ 编辑: reptile0426 来自: 163.25.101.28 (06/24 03:53)