Advertisement
Guest User

Untitled

a guest
Jan 12th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.99 KB | None | 0 0
  1. alias modulateIntegers {
  2.   var %totalInts $1, %currentInt 0, %currentModulatorDepth $iif($2,$2,1), %powerSet 0 $+ $3, %modulator (2 ^ x), %return
  3.  
  4.   if ($calc(%totalInts / (2 ^ %currentModulatorDepth)) >= 1) {
  5.     while (%currentInt <= %totalInts) {
  6.       if ($calc(%currentInt % (2 ^ (%currentModulatorDepth))) == 0) {
  7.         echo -a CurrentInt: %currentInt CurrentModulatorDepth: %currentModulatorDepth  CurrentModulator: $calc(2 ^ %currentModulatorDepth)
  8.         var %currentModulatorPower 1
  9.         while ($calc(%currentInt % (2^(%currentModulatorDepth + %currentModulatorPower))) == 0 && %currentModulatorPower < 98) {
  10.           inc %currentModulatorPower
  11.         }
  12.         var %modInts $addtok(%modInts,%currentModulatorPower,32)
  13.         var %colors  $+ $base(%currentModulatorPower,10,10,2))
  14.         var %buffer %colors $+ $iif(%currentInt < 1,%currentInt,$calc((%currentInt - (2 * %currentModulatorDepth - 1)) * (2 ^ %powerSet))) $+ $Left(%colors,2)
  15.         var % $+ ModInts $+ %currentModulatorPower [ % $+ [ ModInts $+ [ %currentModulatorPower ] ] ] %buffer
  16.         %return = %return %buffer
  17.  
  18.       }
  19.       inc %currentInt 1
  20.     }
  21.     var %x 1
  22.     while ($token(%modInts,%x,32) != $null) {
  23.       %return = $addtok(%return,[ % $+ [ ModInts $+ [ $v1 ] ] ],58)
  24.  
  25.       inc %x
  26.     }
  27.     while %x {
  28.       %return = $addtok(%return,$_ModulateIntegers(%totalInts,$calc(%currentModulatorDepth + 1),%powerSet),43)
  29.       dec %x
  30.     }
  31.     return %return
  32.   }
  33. }
  34.  
  35. alias _ModulateIntegers {
  36.   var %totalInts $1, %currentInt 0, %currentModulatorDepth $iif($2,$2,1), %powerSet 0 $+ $3, %modulator (2 ^ x), %return
  37.  
  38.   if ($calc(%totalInts / (2 ^ %currentModulatorDepth)) >= 1) {
  39.     while (%currentInt <= %totalInts) {
  40.       if ($calc(%currentInt % (2 ^ (%currentModulatorDepth))) == 0) {
  41.         echo -a CurrentInt: %currentInt CurrentModulatorDepth: %currentModulatorDepth  CurrentModulator: $calc(2 ^ %currentModulatorDepth)
  42.         var %currentModulatorPower 1
  43.         while ($calc(%currentInt % (2^(%currentModulatorDepth + %currentModulatorPower))) == 0 && %currentModulatorPower < 98) {
  44.           inc %currentModulatorPower
  45.         }
  46.         var %modInts $addtok(%modInts,%currentModulatorPower,32)
  47.         var %colors  $+ $base(%currentModulatorPower,10,10,2))
  48.         var %buffer %colors $+ $iif(%currentInt < 1,%currentInt,$calc((%currentInt - (2 * %currentModulatorDepth - 1)) * (2 ^ %powerSet))) $+ $Left(%colors,2)
  49.         var % $+ ModInts $+ %currentModulatorPower [ % $+ [ ModInts $+ [ %currentModulatorPower ] ] ] %buffer
  50.         %return = %return %buffer
  51.  
  52.       }
  53.       inc %currentInt 1
  54.     }
  55.     var %x 1
  56.     while ($token(%modInts,%x,32) != $null) {
  57.       %return = $addtok(%return,[ % $+ [ ModInts $+ [ $v1 ] ] ],58)
  58.       inc %x
  59.     }
  60.     while %x {
  61.       %return = $addtok(%return,$__ModulateIntegers(%totalInts,$calc(%currentModulatorDepth + 1),%powerSet),43)
  62.       dec %x
  63.     }
  64.     return %return
  65.   }
  66. }
  67.  
  68. alias __ModulateIntegers {
  69.   return $ModulateIntegers($1,$2,$3)
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement