Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias modulateIntegers {
- var %totalInts $1, %currentInt 0, %currentModulatorDepth $iif($2,$2,1), %powerSet 0 $+ $3, %modulator (2 ^ x), %return
- if ($calc(%totalInts / (2 ^ %currentModulatorDepth)) >= 1) {
- while (%currentInt <= %totalInts) {
- if ($calc(%currentInt % (2 ^ (%currentModulatorDepth))) == 0) {
- echo -a CurrentInt: %currentInt CurrentModulatorDepth: %currentModulatorDepth CurrentModulator: $calc(2 ^ %currentModulatorDepth)
- var %currentModulatorPower 1
- while ($calc(%currentInt % (2^(%currentModulatorDepth + %currentModulatorPower))) == 0 && %currentModulatorPower < 98) {
- inc %currentModulatorPower
- }
- var %modInts $addtok(%modInts,%currentModulatorPower,32)
- var %colors $+ $base(%currentModulatorPower,10,10,2))
- var %buffer %colors $+ $iif(%currentInt < 1,%currentInt,$calc((%currentInt - (2 * %currentModulatorDepth - 1)) * (2 ^ %powerSet))) $+ $Left(%colors,2)
- var % $+ ModInts $+ %currentModulatorPower [ % $+ [ ModInts $+ [ %currentModulatorPower ] ] ] %buffer
- %return = %return %buffer
- }
- inc %currentInt 1
- }
- var %x 1
- while ($token(%modInts,%x,32) != $null) {
- %return = $addtok(%return,[ % $+ [ ModInts $+ [ $v1 ] ] ],58)
- inc %x
- }
- while %x {
- %return = $addtok(%return,$_ModulateIntegers(%totalInts,$calc(%currentModulatorDepth + 1),%powerSet),43)
- dec %x
- }
- return %return
- }
- }
- alias _ModulateIntegers {
- var %totalInts $1, %currentInt 0, %currentModulatorDepth $iif($2,$2,1), %powerSet 0 $+ $3, %modulator (2 ^ x), %return
- if ($calc(%totalInts / (2 ^ %currentModulatorDepth)) >= 1) {
- while (%currentInt <= %totalInts) {
- if ($calc(%currentInt % (2 ^ (%currentModulatorDepth))) == 0) {
- echo -a CurrentInt: %currentInt CurrentModulatorDepth: %currentModulatorDepth CurrentModulator: $calc(2 ^ %currentModulatorDepth)
- var %currentModulatorPower 1
- while ($calc(%currentInt % (2^(%currentModulatorDepth + %currentModulatorPower))) == 0 && %currentModulatorPower < 98) {
- inc %currentModulatorPower
- }
- var %modInts $addtok(%modInts,%currentModulatorPower,32)
- var %colors $+ $base(%currentModulatorPower,10,10,2))
- var %buffer %colors $+ $iif(%currentInt < 1,%currentInt,$calc((%currentInt - (2 * %currentModulatorDepth - 1)) * (2 ^ %powerSet))) $+ $Left(%colors,2)
- var % $+ ModInts $+ %currentModulatorPower [ % $+ [ ModInts $+ [ %currentModulatorPower ] ] ] %buffer
- %return = %return %buffer
- }
- inc %currentInt 1
- }
- var %x 1
- while ($token(%modInts,%x,32) != $null) {
- %return = $addtok(%return,[ % $+ [ ModInts $+ [ $v1 ] ] ],58)
- inc %x
- }
- while %x {
- %return = $addtok(%return,$__ModulateIntegers(%totalInts,$calc(%currentModulatorDepth + 1),%powerSet),43)
- dec %x
- }
- return %return
- }
- }
- alias __ModulateIntegers {
- return $ModulateIntegers($1,$2,$3)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement