loop bitwise exponential with modulus ? (solved)

Discussion in 'Learning Javascript' started by Jonforum, Jul 23, 2017.

    Tags:
  1. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,574
    Likes Received:
    1,339
    Location:
    Canada / Qu├ębec
    First Language:
    French
    Primarily Uses:
    RMMV
    I want to give a little headache to the mathematician.
    I want to put a formula in a loop.

    My context is the following.

    awefdaf3.jpg

    i need use Bitwise and Moduluse.
    thank for sugestion
    PHP:
                for (var i=0,D=p.f46e42DX;i<6;i++){
                    
    = (~D+1)*((i+1)%2);
                    
    console.log('D : ');
                    
    $gameScreen.showPicture(pID++, this.pFNR[0+i], 1p.c85109[0]+Dp.c85109[1]).spine(spineIDReward); //#c85109 REWARD ICONS
                
    }
    My little coffee with rum, which prevents me to find a formula coherente, I absolutely want to go through these 2 operators.
    Do you have any mathematical suggestion?

    I just have to spread the images here by the center
    Therefore logically.
    Pic 1: -50X
    pic2: +50X
    Pic3:-100X
    Pix4:+100X
    pic5:-150X
    pic6:+150X .....
    .........................

    thank for help


    edit:
    easy way with random
    PHP:
        var startingID = ~~(Math.random() * (this._aniControler._motionStep.starting[lastDX].length)); //starting
        
    var startingMotion this._aniControler.getMotionFromName(this._aniControler._motionStep.starting[lastDX][startingID]);
        var 
    reverseID = ~~(Math.random() * (this._aniControler._motionStep.reversing[lastDX].length)); //reversing
        
    var reversingMotion this._aniControler.getMotionFromName(this._aniControler._motionStep.reversing[lastDX][reverseID]);
        var 
    movingID = ~~(Math.random() * (this._aniControler._motionStep.moving[lastDX].length)); //moving
        
    var movingMotion this._aniControler.getMotionFromName(this._aniControler._motionStep.moving[lastDX][movingID]);
        var 
    endingID = ~~(Math.random() * (this._aniControler._motionStep.ending[lastDX].length)); //ending
        
    var endingMotion this._aniControler.getMotionFromName(this._aniControler._motionStep.ending[lastDX][endingID]);
     
    Last edited: Dec 22, 2017
    #1

Share This Page