Re: [問題] 棍 快被搞瘋了 Random問題

看板C_Sharp (C#)作者 ( )時間18年前 (2007/06/24 03:05), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/4 (看更多)
補上程式碼 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)
文章代碼(AID): #16VMxeOw (C_Sharp)
文章代碼(AID): #16VMxeOw (C_Sharp)