tglogo.png
0 LIKES

Snippet


MasterVar Game for mIRC by manish17xxx

In Category General IRC Posted by Snippets On 12/06/23

So this is my latest Math game which takes some real math skills and fast mind calculations to win. You get a set of numbers, some target numbers, and some operations. Your target is to use the numbers to form the target number by using the operations in the correct order. First player to score 50 points wins the game.

COMMANDS:-
!mastervar - Start a game of MasterVar Multiplayer
!mastervar 1 - Start a game of MasterVar Solo
!stopmaster - Stop the game
!surrender - Give up the game.
!eval : Answer by writing your chosen numbers separated by spaces or by providing the entire expression.

UPDATED -
V.1.1 - MULTIPLAYER MODE ADDED
V.1.2 - ADDED SOME NEW FEATURES
############################################################
##       MasterVar - A Math Game For Masterminds!   ##
##       Version: 1.2              ##
##       By: manish17               ##
##       irc.lunarirc.net   #LunarIRC #LunarGames   User - manish  
  Follow my blog : https://manishsnippets.blogspot.com ##
############################################################
on *:TEXT:!mastervar*:#: {
  if ( %master != 1 ) && (%ongoing == $null) && ($2 == 1) { 
    set %ongoing MasterVar
    set %chan $chan
    set %master 1 
    set %round 1
    msg $chan 9 You have began a game of 4MasterVarSolo.5 Get ready.....
    if (%highestscorerofmastervar != $null) { msg %chan 6Latest Winner: 4 %highestscorerofmastervar }
    set %player $nick
    set %score 0
    timer 1 3 nround
  }
  elseif ( %master != 1 ) && (%ongoing == $null) {
    set %ongoing MasterVar
    set %chan $chan
    set %master 2
    set %round 1
    msg $chan 5MasterVar1 has been started. A series of numbers, operations and targets is given in each round. You have to use the numbers with the given operations correctly to reach the target number.
    timer 1 2 msg $chan First player to 12 Score 50 points1 wins. 
    timer 1 4 mround
  } 

}

on *:TEXT:!stopmaster*:#: {
  msg $chan 3 MasterVar has been ended or stopped.
  endgame
}

on *:TEXT:!surrender*:#: {
  if ( %master == 1) {
    msg %chan 3 You have decided to surrender, so you end up the game getting %score coins.
    coins %player %score 
    endgame
  }
}

alias -l bscore { 
  if ( $istok(%plr,$1,32) == $false) { 
    set %plr $addtok(%plr,$1,32)
    set %pts $instok(%pts,$2,$calc( $numtok(%pts,32) + 1 ),32)
  }
  else { 
    var %rq = $findtok(%plr,$1,1,32)
    var %ne = $calc( $gettok(%pts,%rq,32) + $2 ) 
    set %pts $deltok(%pts,%rq,32)
    set %pts $instok(%pts,%ne,%rq,32) 
  }
  var %p = $sorttok(%pts,32,nr)
  if ( $gettok(%p,1,32) >= 50 ) { set %finished 1 } 
}

alias -l finish { 
  timers off
  var %x = 1 
  while ( %x <= $numtok(%plr,32) ) { 
    coins $gettok(%plr,%x,32) $gettok(%pts,%x,32)
    inc %x 
  }
  var %t = $gettok($sorttok(%pts,32,nr),1,32)
  var %q = $gettok(%plr,$findtok(%pts,%t,1,32),32)
  msg %chan 5 %q has scored %t points, and so he is the winner of the game getting %t coins! Well played!  
  timer 1 3 endgame
}

alias -l validatea { 
  var %curop = $gettok(%ops,%mround,46)
  var %curtar = $gettok(%target,%mround,46)
  var %newer = $replace($1-,$left(%curop,1),$chr(32),$mid(%curop,2,1),$chr(32),$right(%curop,1),$chr(32))
  var %x = 1 
  var %secondcopy = %copy
  while ( %x <= $numtok(%newer,32) ) { 
    if ( $gettok(%newer,%x,32) !isnum ) || (!$istok(%secondcopy,$gettok(%newer,%x,32),32)) { return Your expression is either invalid, or does not evaluate to %curtar $+ . } 
    else { 
      var %secondcopy = $remtok(%secondcopy,$gettok(%newer,%x,32),1,32)
    }
    inc %x 
  }
  if ( 2 \\ %round ) { 
    var %exp = $gettok(%newer,1,32) $+ $left(%curop,1) $+ $gettok(%newer,2,32) $+ $right(%curop,1) $+ $gettok(%newer,3,32)
    if ( $numtok(%newer,32) != 3 ) { return Invalid! Make sure you are using exactly 3 numbers. } 
  }
  if ( 2 // %round ) { 
    var %exp = $gettok(%newer,1,32) $+ $left(%curop,1) $+ $gettok(%newer,2,32) $+ $mid(%curop,2,1) $+ $gettok(%newer,3,32) $+ $right(%curop,1) $+ $gettok(%newer,4,32)
    if ( $numtok(%newer,32) != 4 ) { return Invalid! Make sure you are using exactly 4 numbers. } 
  }
  if ( $calc(%exp) != %curtar ) { 
    return Your expression does not evaluate to required target. 
  }
  return $true
}

on *:TEXT:*:#: {
  if ( %master == 2 ) && ( %answers == 1 ) && ( $chan == %chan ) { 
    if ( $validatea($1-) == $true ) { 
      var %curop = $gettok(%ops,%mround,46)
      set %newer $replace($1-,$left(%curop,1),$chr(32),$mid(%curop,2,1),$chr(32),$right(%curop,1),$chr(32))
      if ( $sorttok(%newer,32,n) == $sorttok($gettok(%nos,%mround,46),32,n) )  {
        timers off
        unset %answers
        var %x = 1
        msg %chan 9 You have chosen the correct numbers:5 %newer , and hence, you get $calc( 5 * ( 2 - %round % 2 ) ) points.
        bscore $nick $calc( 5 * ( 2 - %round % 2 ) )
        timer 1 2 score
        while ( %x <= $numtok(%newer,32) ) { 
          set %copy $remtok(%copy,$gettok(%newer,%x,32),1,32)
          inc %x
        }

        if ( %finished != 1 ) { 
          inc %mround
          if ( %mround == 4 ) && ($numtok(%copy,32) == 0 ) { 
            inc %round 
            unset %answers
            timer 1 4 msg %chan 11 Congratulations,5 this round has been successfully completed. Be ready for the next round... 
            timer 1 6 mround 
          }
          else {
            timer 1 4 msg %chan Your numbers remaining are:9 %copy
            timer 1 4 msg %chan Your current operation is:1 $gettok(%ops,%mround,46)$chr(58) $+ $chr(58) $grt(%round) and your 3current target11 is $gettok(%target,%mround,46) .
            timer 1 4 set %answers 1
            timer 1 64 solution
          }
        }
        else { 
          timer 1 4 finish
        }
      }
      else { 
        notice $nick Well that's not the correct expression. Try again!
      }
    }
    else { 
      if ($remove($1-,$chr(32),+,-,*,/) isnum ) {
        notice $nick $validatea($1-) 
      }
    }
  }
}

on *:TEXT:!eval*:#: {
  if ( %answers == 1) && ($nick == %player) && ($validate($2-) == $true) { 
    var %curop = $gettok(%ops,%mround,46)
    var %newer = $replace($2-,$left(%curop,1),$chr(32),$mid(%curop,2,1),$chr(32),$right(%curop,1),$chr(32))
    var %x = 1
    while ( %x <= $numtok(%newer,32) ) { 
      set %copy $remtok(%copy,$gettok(%newer,%x,32),1,32)
      inc %x
    }
    msg %chan 5 You have used the numbers %newer to create5 $gettok(%target,%mround,46) . 
    msg %chan 9Well done. You get $calc($ceil($calc(%round / 2) ) * 5) points. You now have $numtok(%copy,32) numbers remaining. 
    set %score $calc(%score + $ceil($calc(%round / 2))  * 5) 
    inc %mround
    if ( %mround == 4 ) && ($numtok(%copy,32) == 0 ) { 
      timers off
      inc %round 
      unset %answers
      timer 1 2 msg %chan 11 Congratulations,5 you have successfully completed this round.
      if ( %round == 3 ) || ( %round == 5 ) { 
        timer 1 3 msg %chan 9 You get a bonus of 5 points for your amazing performance! 
        set %score $calc( %score + 5)
      } 
      if ( %round != 5 ) { timer 1 4 msg %chan 10 Get ready for the next round... }  
      timer 1 5 nround 
    }
    else {
      timer 1 2 msg %chan 11 Your current operation is: $gettok(%ops,%mround,46) and your 3current target11 is $gettok(%target,%mround,46) .
      timer 1 2 notice $nick Your numbers remaining are: %copy
    }
  }
  elseif ( %answers == 1) && ($nick == %player) && ($validate($2-) != $true) { 
    notice %player $validate($2-) 
  } 
}

alias -l validate { 
  var %curop = $gettok(%ops,%mround,46)
  var %curtar = $gettok(%target,%mround,46)
  var %newer = $replace($1-,$left(%curop,1),$chr(32),$mid(%curop,2,1),$chr(32),$right(%curop,1),$chr(32))
  var %x = 1 
  var %secondcopy = %copy
  while ( %x <= $numtok(%newer,32) ) { 
    if ( $gettok(%newer,%x,32) !isnum ) || (!$istok(%secondcopy,$gettok(%newer,%x,32),32)) { return Your expression is either invalid, or does not evaluate to %curtar $+ . } 
    else { 
      var %secondcopy = $remtok(%secondcopy,$gettok(%newer,%x,32),1,32)
    }
    inc %x 
  }
  if ( %round <= 2 ) { 
    var %exp = $gettok(%newer,1,32) $+ $left(%curop,1) $+ $gettok(%newer,2,32) $+ $right(%curop,1) $+ $gettok(%newer,3,32)
    if ( $numtok(%newer,32) != 3 ) { return Invalid! Make sure you are using exactly 3 numbers. } 
  }
  if ( %round > 2 ) && ( %round <= 4 ) { 
    var %exp = $gettok(%newer,1,32) $+ $left(%curop,1) $+ $gettok(%newer,2,32) $+ $mid(%curop,2,1) $+ $gettok(%newer,3,32) $+ $right(%curop,1) $+ $gettok(%newer,4,32)
    if ( $numtok(%newer,32) != 4 ) { return Invalid! Make sure you are using exactly 4 numbers. } 
  }
  if ( $calc(%exp) != %curtar ) { 
    return Your expression is either incorrectly written or does not evaluate to the required target.
  }
  return $true
}

alias -l timegone { 
  msg %chan 4 Your time is up! You finish the game, getting %score coins. 
  coins %player %score 
  endgame
}

alias -l coins {
  if ($read(coins.txt,w,* $+ $1 $+ *)) {
    set %n $readn $+
    set %data $read(coins.txt,w,* $+ $1 $+ *)
    set %current $gettok(%data,2,32) 
    set %new $calc(%current + $2)
    set %data $replace(%data,%current,%new)
    write -dl $+ %n coins.txt
    write coins.txt %data 
  }
  else { 
    write coins.txt $1 $2
  }
}

alias -l endgame { 
  timers off
  unset %mround %round %chan %ongoing %master %copy %vars %target %nos %ops %player %ohg %answers %score %plr %pts %newer %finished %store %n %data %current %new %ofu %tc
}

alias -l showscore { 
  if (%round != 1) { 
    msg %chan 4Current score: 5 %score 
  }
}
alias -l nround {
  timers off 
  showscore
  if ( %round <= 2 ) { 
    generate3
    set %mround 1
    set %copy $sorttok($replace(%nos,.,$chr(32)),32,n)
    msg %chan 11 The operations selected are:1 $chr(124) $gettok(%ops,1,46) $chr(124) $gettok(%ops,2,46) $chr(124) $gettok(%ops,3,46) $chr(124)
    timer 1 3 msg %chan 5 The targets are: $gettok(%target,1,46) $gettok(%target,2,46) $gettok(%target,3,46)
    timer 1 5 msg %chan 6 Your numbers are: %copy
    timer 1 5 notice %player Type !eval followed by the numbers or the expression to answer.
    timer 1 5 set %answers 1
    timer 1 65 timegone
  }
  elseif ( %round <= 4 ) {
    generate4
    set %mround 1
    set %copy $sorttok($replace(%nos,.,$chr(32)),32,n)
    msg %chan 11 The operations selected are:1 $chr(124) $gettok(%ops,1,46) $chr(124) $gettok(%ops,2,46) $chr(124) $gettok(%ops,3,46) $chr(124)
    timer 1 3 msg %chan 5 The targets are: $gettok(%target,1,46) $gettok(%target,2,46) $gettok(%target,3,46)
    timer 1 5 msg %chan 6 Your numbers are: %copy
    timer 1 5 notice %player Type !eval followed by the numbers or the expression to answer.
    timer 1 5 set %answers 1
    timer 1 95 timegone
  }
  elseif (%round == 5) { 
    timer 1 2 msg %chan 3Congratulations! You have won the game, scoring %score points. You have earned %score coins.
    timer 1 2 coins %player %score
    timer 1 2 set %highestscorerofmastervar %player
    timer 1 3 endgame
  }
}

alias -l score { 
  var %lv = 1
  unset %store
  while ( %lv <= $numtok(%pts,32) ) { 
    set %store %store 4 $gettok(%plr,%lv,32) :9 $gettok(%pts,%lv,32) 
    inc %lv
  }
  msg %chan 3 Current Scores: %store
}

alias -l solution { 
  timers off
  var %snos = $gettok(%nos,%mround,46)
  var %cops = $gettok(%ops,%mround,46)
  if ( 2 // %round ) { var %expression = $gettok(%snos,1,32) $+ $left(%cops,1) $+ $gettok(%snos,2,32) $+ $mid(%cops,2,1) $+ $gettok(%snos,3,32) $+ $right(%cops,1) $+ $gettok(%snos,4,32) }
  if ( 2 \\ %round ) { var %expression = $gettok(%snos,1,32) $+ $left(%cops,1) $+ $gettok(%snos,2,32) $+ $right(%cops,1) $+ $gettok(%snos,3,32) }
  msg %chan 12 Oops, looks like nobody got that! The correct expression was: %expression $+ . Get ready to continue... 
  inc %mround 
  set %newer %snos
  var %x = 1
  while ( %x <= $numtok(%newer,32) ) { 
    set %copy $remtok(%copy,$gettok(%newer,%x,32),1,32)
    inc %x
  }
  if ( %mround == 4 ) && ($numtok(%copy,32) == 0 ) { 
    inc %round 
    unset %answers
    timer 1 4 msg %chan 11 Proceeding to next round.... 
    timer 1 6 mround 
  }
  else {
    timer 1 4 msg %chan Your numbers remaining are:9 %copy
    timer 1 4 msg %chan Your current operation is: $gettok(%ops,%mround,46) $chr(58) $+ $chr(58) $grt(%round) and your 3current target11 is $gettok(%target,%mround,46) .
    timer 1 4 set %answers 1
    timer 1 64 solution
  }
}

alias -l mround { 
  timers off
  if ( 2 // %round  ) { 
    generate4
    set %mround 1
    set %copy $sorttok($replace(%nos,.,$chr(32)),32,n)
    msg %chan 11 The operations selected are:1 $chr(124) $gettok(%ops,1,46) $chr(124) $gettok(%ops,2,46) $chr(124) $gettok(%ops,3,46) $chr(124)
    timer 1 4 msg %chan 5 The targets are: $gettok(%target,1,46) $gettok(%target,2,46) $gettok(%target,3,46)
    timer 1 7 msg %chan 5 Your numbers are: %copy ,current target: $gettok(%target,1,46) 1(using $gettok(%ops,1,46) $chr(58) $+ $chr(58) %tc
    timer 1 7 set %answers 1
    timer 1 67 solution
  }  
  else { 
    generate3
    set %mround 1
    set %copy $sorttok($replace(%nos,.,$chr(32)),32,n)
    msg %chan 11 The operations selected are:1 $chr(124) $gettok(%ops,1,46) $chr(124) $gettok(%ops,2,46) $chr(124) $gettok(%ops,3,46) $chr(124)
    timer 1 4 msg %chan 5 The targets are: $gettok(%target,1,46) $gettok(%target,2,46) $gettok(%target,3,46)
    timer 1 7 msg %chan 11 Your numbers are: %copy , and your current target is: $gettok(%target,1,46) (using $gettok(%ops,1,46) $chr(58) $+ $chr(58) %tc )
    timer 1 7 set %answers 1
    timer 1 67 solution
  }
}

alias -l getfactor { 
  unset %ohg
  var %k = 2 
  while ( %k <= $calc($1 / 2 ) ) { 
    if ( %k // $1 ) { 
      set %ohg $addtok(%ohg,%k,46)
    }
    inc %k
  }
  return $gettok(%ohg,$rand(1,$numtok(%ohg,46)),46) 
}

alias -l grt { 
  set %ofu $gettok(%ops,%mround,46)
  if ( $calc( $1 % 2 ) == 1 ) { 
    set %ofu n $+ $left(%ofu,1) $+ n $+ $right(%ofu,1) $+ n
    set %tc $cleanequation(%ofu)
  }
  else { 
    set %ofu n $+ $left(%ofu,1) $+ n $+ $mid(%ofu,2,1) $+ n $+ $right(%ofu,1) $+ n
    set %tc $cleanequation(%ofu)
  }
  return %tc 
}

alias -l generate3 { 
  set %vars ++.+-.+*.*+.+/./+.*/.**.*-.-*.-+.-+
  var %x = 1
  unset %target %nos %ops
  var %list = 6.8.10.12.14.16.18.20/2/7.8.9.10.12.14.16.18.20/5.6.7.8.9.10/4.5.6.7.8.9.10.11.12/3.4.5.6.7.8.9/3.4.5.6.7.8.9.10.12.14.16.18.20/6.7.8.9.10.12.4.5
  while (%x <= 3 ) { 
    var %m = $gettok(%vars,$rand($calc((%x - 1 )* 4 + 1),$calc(%x * 4)),46)
    set %ops $instok(%ops,%m,%x,46)
    var %thattok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($left(%m,1)),46) - 1 ),47)
    var %thistok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($left(%m,1)),46)),47)
    var %a = $gettok(%thattok,$rand(1,$numtok(%thattok,46)),46)
    var %b = $gettok(%thistok,$rand(1,$numtok(%thistok,46)),46)
    var %thistok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($right(%m,1)),46)),47)
    var %c = $gettok(%thistok,$rand(1,$numtok(%thistok,46)),46)

    if ( $left(%m,1) == $chr(47) ) { 
      var %b = $getfactor(%a)
    }
    if ($right(%m,1) == $chr(47) ) { 
      var %b = $gettok($gettok(%list,1,47),$rand(1,8),46)
      var %c = $getfactor(%b)
    }
    set %nos $instok(%nos,%a %b %c,%x,46)
    var %exp = %a $+ $left(%m,1) $+ %b $+ $right(%m,1) $+ %c
    set %target $instok(%target,$calc(%exp),%x,46)
    inc %x 
  }

  set %ofu $gettok(%ops,1,46)
  set %ofu n $+ $left(%ofu,1) $+ n $+ $right(%ofu,1) $+ n
  set %tc $cleanequation(%ofu)
}

alias -l generate4 { 
  set %vars +++.*+*.*+-.*-*.*++.*--.+-*.-+*.*+/./+*./*+./++.*-+.**/.*-/.*/-.+*+.*/+
  var %x = 1
  unset %target %nos %ops
  var %list = 6.8.10.12.14.16.18.20/2/7.8.9.10.12.14.16.18.20/5.6.7.8.9.10/4.5.6.7.8.9.10.11.12/3.4.5.6.7.8.9/3.4.5.6.7.8.9.10.12.14.16.18.20/6.7.8.9.10.12.4.5
  while (%x <= 3 ) { 
    var %m = $gettok(%vars,$rand($calc((%x - 1 )* 6 + 1),$calc(%x * 6)),46)
    set %ops $instok(%ops,%m,%x,46)
    var %thattok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($left(%m,1)),46) - 1 ),47)
    var %thistok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($left(%m,1)),46)),47)
    var %a = $gettok(%thattok,$rand(1,$numtok(%thattok,46)),46)
    var %b = $gettok(%thistok,$rand(1,$numtok(%thistok,46)),46)
    var %thistok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($mid(%m,2,1)),46)),47)
    var %c = $gettok(%thistok,$rand(1,$numtok(%thistok,46)),46)
    var %thistok = $gettok(%list,$calc( 2 * $findtok(47.45.42.43,$asc($right(%m,1)),46)),47)
    var %d = $gettok(%thistok,$rand(1,$numtok(%thistok,46)),46)

    if ( $left(%m,1) == $chr(47) ) { 
      var %b = $getfactor(%a)
    }
    if ($mid(%m,2,1) == $chr(47) ) { 
      var %b = $gettok($gettok(%list,1,47),$rand(1,8),46)
      var %c = $getfactor(%b)
    }
    if ($right(%m,1) == $chr(47) ) {
      var %c = $gettok($gettok(%list,1,47),$rand(1,8),46)
      var %d = $getfactor(%c)
    }
    set %nos $instok(%nos,%a %b %c %d,%x,46)
    var %exp = %a $+ $left(%m,1) $+ %b $+ $mid(%m,2,1) $+ %c $+ $right(%m,1) $+ %d
    set %target $instok(%target,$calc(%exp),%x,46)
    inc %x 
  }
  set %ofu $gettok(%ops,1,46)
  set %ofu n $+ $left(%ofu,1) $+ n $+ $mid(%ofu,2,1) $+ n $+ $right(%ofu,1) $+ n
  set %tc $cleanequation(%ofu)
}

alias -l cleanEquation {
  var %f = $1-
  if ($count(%f,$chr(40)) != $count(%f,$chr(41))) %f = $iif($v1 > $v2,%f) $str($iif($v1 < $v2,$chr(40),$chr(41)) $+ $chr(32),$abs($calc($v2 - $v1))) $iif($v1 < $v2,%f)
  var %e = $chr(40) $cleanseEquation(%f) $chr(41), %x = 1, %p, %count = 0, %abc = 161, %signs = $+(^,*/,$chr(37),+-), %q, %abcd, %y, %m, %t
  while ($numtok(%e,32) > 1) {
    %p = $gettok(%e,%x,32)
    if (%p == $chr(40)) {
      inc %count
      var %count [ $+ [ $+(_,%count) ] ] %x
    }
    elseif (%p == $chr(41)) {
      var %abc [ $+ [ $+(_,%abc) ] ] $gettok(%e,$+($($+($chr(37),count,_,%count),2),-,%x),32)
      %e = $iif($+($($+($chr(37),count,_,%count),2)) > 1, $gettok(%e,$+(1,-,$calc($($+($chr(37),count,_,%count),2) - 1)),32),$null) $chr(%abc) $gettok(%e,$+($calc(%x + 1),-),32)
      %m = $remove(%e,$chr(32))
      if ($calc($count(%m,$chr(40))) > 1) && ($calc(($len(%m) - $count(%m,$chr(40))) * 2) <= 1) {
        %t = $calc($pos(%e,$chr(40),$pos(%e,$chr(40),0)) + 1)
        %e = $chr(40) $mid(%e,%t,$calc(($pos(%e,$chr(41),1) - 1) - %t)) $chr(41)
      }
      inc %abc
      %x = 0
      %count = 0
    }
    inc %x
  }
  while (%abc > 161) {
    dec %abc
    %p = $replace($($+($chr(37),abc,_,%abc),2),$str($chr(40),2),$chr(40),$str($chr(41),2),$chr(41))
    if ($numtok(%p,32) == 3) && ($gettok(%p,2,32) !isnum) %p = $gettok(%p,2,32)
    %abcd = 261
    if ($numtok(%p,32) > 5) {
      %y = 1
      while (%y <= 5) {
        %x = 1
        while (%x <= $numtok(%p,32)) {
          %q = $gettok(%p,%x,32)
          if (%q isin $mid(%signs,%y,$iif(%y == 1,1,$iif(%y == 2,3,2)))) {
            var %abcd [ $+ [ $+(_,%abcd) ] ] $+($chr(40),$chr(32),$gettok(%p,$+($calc(%x - 1),-,$calc(%x + 1)),32),$chr(32),$chr(41))
            %p = $gettok(%p,$+(1,-,$calc(%x - 2)),32) $chr(%abcd) $gettok(%p,$+($calc(%x + 2),-),32)
            inc %abcd
          }
          else inc %x
        }
        inc %y $iif(%y == 1,1,3)
      }
      while (%abcd > 261) {
        dec %abcd
        if ($numtok(%p,32) == 3) && ($gettok(%p,2,32) !isnum) %p = $($+($chr(37),abcd,_,%abcd),2)
        else %p = $replacecs(%p,$chr(%abcd),$($+($chr(37),abcd,_,%abcd),2))
      }
    }
    %e = $replacecs(%e,$chr(%abc),%p)
  }
  %e = $iif($regsubex(regextest,%e,\(([^()]|(?R))*\),$null),$+($chr(40),%e,$chr(41)),%e)
  return $replace(%e,$+($chr(40),$chr(32)),$chr(40),$+($chr(32),$chr(41)),$chr(41))
}
alias -l cleanseEquation {
  var %t, %s = $replace($remove($chr(40) $1- $chr(41),$chr(32)),$chr(41),$scc($chr(41)),$chr(40),$scc($chr(40)))
  while (%s != $replace(%s,**,*,^^,^,$str($chr(37),2),$chr(37),//,/,++++,++,----,--,-+-+,-+,+-+-,+-,++-+,-+,--+-,+-,-++-,+-,+--+,-+,+---,+-,-+++,-+,++--,--,--++,++,+++-,+-,---+,-+)) %s = $v2
  %s = $replace(%s,+-+,+,+--,+-,+++,+,++-,+-,-++,+,-+-,+-,--+,+,---,+-,-+,-,^--,^,*--,*,$+($chr(37),--),$chr(37),/--,/,^+-,^-,*+-,*-,$+($chr(37),+-),$+($chr(37),-),/+-,/-)
  %s = $replace(%s,$scb(--),$scb($null),$scb(+-),$scb(-),$scb(++),$scb($null),$scb(-+),$scb(-),++,+,-+,-,*-,* $chr(512),+-,+ $chr(512),--,- $chr(512),/-,/ $chr(512),^-,^ $chr(512),$+($chr(37),-),$chr(37) $chr(512),$+($chr(40),$chr(160),-),$chr(512),$+($chr(40),$chr(160),+),$null,-,$scc(-),*+,*,^+,^,$+($chr(37),+),$chr(37),/+,/)
  return $replace(%s,+,$scc(+),^,$scc(^),%,$scc(%),*,$scc(*),/,$scc(/),$chr(512),-,$chr(513),+,$chr(160),$chr(32))
}
alias -l scc return $+($chr(160),$1,$chr(160))
alias -l scb return $+($chr(40),$chr(160),$1)


Comments 0


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand