Re: 剛剛安霆要我寫的樂透猜碼程式~~

看板NTUBA95study作者 ( Je t'aime)時間21年前 (2003/01/15 10:52), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
你搞錯人了拉.... 是我問的拉.... 我有稍微修改一下說.... <html> <head> </head> <body> <script language="JavaScript"><!-- var m var tests=new Array() tests[0]=0 for(i=0;i<6;i++) { for(k=1;m!=-1;k++) { x=Math.floor(Math.random()*42+1) tests[i+1]=x for(j=0;j<i+1;j++) { if(tests[i+1]==tests[j]) {x=Math.floor(Math.random()*42+1) tests[i+1]=x j=0 } if (j==i) {m=-1} } } m=1 document.write(x) document.write(",") } // --></script> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw) ◆ From: 218.184.52.18
文章代碼(AID): #-9CpOyX (NTUBA95study)
文章代碼(AID): #-9CpOyX (NTUBA95study)