[][src]Function smash::app::sv_math::rand

pub unsafe extern "C" fn rand(rand_type: u64, upper_lim: c_int) -> c_int

Returns a random integer in the range 0 to X-1

Arguments

Example

let rand_val = app::sv_math::rand(hash40("fighter"), 100);
if rand_val == 0 {
    // do something with 1-in-100 chance for a fighter
}