Advertisement
illpastethat

Wordmatch alias

Sep 2nd, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.35 KB | None | 0 0
  1. alias wordmatch {
  2.   var %a $1
  3.   var %b $2
  4.   if ($len(%a) != $len(%b)) {
  5.     return false
  6.   }
  7.   else {
  8.     while ($len(%a) > 0) {
  9.       var %l $left(%a,1)
  10.       if ($count(%a,%l) == $count(%b,%l)) {
  11.         var %a $remove(%a,%l)
  12.         var %b $remove(%b,%l)
  13.       }
  14.       else {
  15.         return false
  16.       }
  17.     }
  18.     return true
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement