Advertisement
Flip

Untitled

Oct 17th, 2013
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. else {
  2.     var b:int = r.wave/10;
  3.     max = r.wave*2;
  4.     var sect:int = max/(b+1);
  5.     var cc:int = 0;
  6.     var cs:int = 1;
  7.     for (i = 0;i <= max;i++) {
  8.         cc++;
  9.         if (cc > sect) {
  10.             cwave.push(9);
  11.             cc = 0;
  12.             cs++;
  13.         }
  14.         else {
  15.             var step:Number;
  16.             if (b % 2 == 0) {
  17.                 step = (9/sect)*2;
  18.                 if (cc > sect/2) { cwave.push(Math.floor(9-((cc-sect/2)*step))); }
  19.                 else { cwave.push(Math.floor((cc-1)*step)); }
  20.             }
  21.             else {
  22.                 step = 9/sect;
  23.                 if (cs % 2 == 0) { cwave.push(Math.ceil(8-((cc-1)*step))); }
  24.                 else { cwave.push(Math.floor((cc-1)*step));  }
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement