# loop bitwise exponential with modulus ? (solved)

#### Jonforum

##### Veteran
I want to give a little headache to the mathematician.
I want to put a formula in a loop.

My context is the following.

i need use Bitwise and Moduluse.
thank for sugestion
PHP:
``````            for (var i=0,D=p.f46e42DX;i<6;i++){
D = (~D+1)*((i+1)%2);
console.log('D : ', D );
\$gameScreen.showPicture(pID++, this.pFNR[0+i], 1, p.c85109[0]+D, p.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:

### Latest Profile Posts

I just noticed the minigame challenge. Now considering...
My project just started lagging during battle and I haven't been able to figure out why...
Oh, Google is now warning users against installing extensions on Edge Chromium
on my plate today- animation.
"Your service has been identified as part of an outage. This is expected to be restored by 7pm IN SEVEN DAYS!!!" Guess I won't be around as much over the next week