C .
ODE
G
AMELET
person_outline
Sign In
forum
Discuss Home
code
Coding Discuss
videogame_asset
Gaming Discuss
work
Project Issues
keyboard_arrow_left
Focus Issue
隨機數生成
Monster
opened 8 months ago
chat
4
add_circle_outline
REPLY
Submit
可以利用 random() 或 random(a,b)
0 <= random() < 1
a <= random(a,b) < b
但要注意的是,取出來的數值會有小數點,
可以利用 floor()(無條件捨去) 或 ceil()(無條件進位) 或 round()(四捨五入) 取得整數。
buhuechuminzu
commented 2 years ago
明白了,謝謝
Monster
commented 2 years ago
參考自 hyper code
randomInt(a,b)
舉例:
亞嬓霸王360度無死角火箭筒
randomInt(0,360)
pufferfish_01
commented 2 years ago
Items per page:
10
1 - 3 of 4
ⒸCode.Gamelet.com |
Privacy Policy
|
Terms of Service