Re: [問題] 棍 快被搞瘋了 Random問題
補上程式碼
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)
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 2 之 4 篇):
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章