取亂數

亂數函數隨機產生0~0.9999的數值

]Math.random();

 

亂數公式: 最大減最小乘以亂數加最小

]Math.random() * (max - min) + min;

 

整數亂數

]Math.round(Math.random() * (max - min)) + min;

文章標籤
全站熱搜
創作者介紹
創作者 GPhettoH 的頭像
GPhettoH

歇息,等待明日的天空

GPhettoH 發表在 痞客邦 留言(0) 人氣(6)