mercredi 22 mars 2017

Is there any way to predict next random number?

I want to make roulette wheel in ActionScript3. I have full source of other roulette, but it generates next number after spin(Eventclick), so I know next number as I click spin button(The value changes faster than visual, before ball stops rotating I know where it falls). In my roulette I want to know what will be next number, before player click spin button. Sorry if I can't explain what I want exactly, but hope you will understand.

package de.polygonal.core.math.random {

public class Random extends Object
{

    public function Random() : void
    {
        return;
    }// end function

    public static function rand() : int
    {
        return Math.random() * 2147483647;
    }// end function

    public static function randRange(param1:int, param2:int) : int
    {
        var _loc_3:* = param1 - 0.4999;
        var _loc_4:* = param2 + 0.4999;
        return _loc_3 + (_loc_4 - _loc_3) * Math.random() + 16384.5 - 16384;
    }// end function

    public static function randSym(param1:int) : Number
    {
        var _loc_2:* = -param1 - 0.4999;
        var _loc_3:* = param1 + 0.4999;
        return _loc_2 + (_loc_3 - _loc_2) * Math.random() + 16384.5 - 16384;
    }// end function

    public static function randBool() : Boolean
    {
        return Math.random() < 0.5;
    }// end function

    public static function frand() : Number
    {
        return Math.random();
    }// end function

    public static function frandRange(param1:Number, param2:Number) : Number
    {
        return param1 + (param2 - param1) * Math.random();
    }// end function

    public static function frandSym(param1:Number) : Number
    {
        var _loc_2:* = -param1;
        return _loc_2 + (param1 - _loc_2) * Math.random();
    }// end function

}

}

Aucun commentaire:

Enregistrer un commentaire