C .
ODE
G
AMELET
Focus Issue
隨機數生成
Monster opened 8 months ago 4
可以利用 random() 或 random(a,b)
 
0 <= random() < 1
 
a <= random(a,b) < b
 
但要注意的是,取出來的數值會有小數點,
 
可以利用 floor()(無條件捨去) 或 ceil()(無條件進位) 或 round()(四捨五入) 取得整數。
明白了,謝謝
參考自 hyper code
 
randomInt(a,b)
 
 
 
舉例:
 
 
randomInt(0,360)
Items per page:
1 - 3 of 4
ⒸCode.Gamelet.com | Privacy Policy | Terms of Service