mIRC Home    About    Download    Register    News    Help

Print Thread
#3238 23/12/02 07:35 PM
Joined: Dec 2002
Posts: 23
R
R1pl3y Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 23
I need help with this.
I did not write the code, I am just trying to fix the error.
The error is: if any one word within $1- has no vowels it will freeze up mIRC requiring a ctrl+break.
It could be the first, last or middle word, it doesnt matter(Ex: [ddffgg Testing the talker] or [Testing the talker ddffgg] or [Testing the ddffgg talker]).
I need to add code to make it look at each word and see if any one word within $1- has no vowels, and halt/error message if there are any words without vowels.
Any help is much appreciated.

Code:
alias pltalk {
  if ($1 == $null) { echo -a Syntax: /pltalk <text> | halt }
  else say $pigl($1-)
}
alias pigl {
  var %a = 1,%v = a.e.i.o.u,%r,%w
  while ($gettok($1-,%a,32) != $null) {
    %w = $lower($ifmatch)
    if ($istok(%v,$mid(%w,1,1),46)) %w = %w $+ way
    else {
      var %c
      while ($mid(%w,1,1) != $null) {
        if (!$istok(%v,$mid(%w,1,1),46)) %w = $right(%w,$iif($mid(%w,1,2) == qu,-2,-1)) $+ $mid(%w,1,$iif($mid(%w,1,2) == qu,2,1))
        else break
      }
      %w = %w $+ ay
    }
    %r = %r $iif($prop == cap,$upper($mid(%w,1,1)) $+ $right(%w,-1),%w)
    inc %a
  }
  return %r
}


R¹¶¬³¥
#3239 24/12/02 01:54 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

alias pigl {
  var %a = 1,%v = a.e.i.o.u,%r,%w
  while ($gettok($1-,%a,32) != $null) {
    %w = $lower($ifmatch)
    ;
    ;  [START of Added Code]
    ;
    if ((a !isin %w) && (e !isin %w) && (i !isin %w) && (o !isin %w) && (u !isin %w)) {
      echo -ati2 %w contains no vowels. ( $+ %r $+ )
      halt
    }
    ;
    ;  [END of Added Code]
    ;
    if ($istok(%v,$mid(%w,1,1),46)) %w = %w $+ way
    else {
      var %c
      while ($mid(%w,1,1) != $null) {
        if (!$istok(%v,$mid(%w,1,1),46)) %w = $right(%w,$iif($mid(%w,1,2) == qu,-2,-1)) $+ $mid(%w,1,$iif($mid(%w,1,2) == qu,2,1))
        else break
      }
      %w = %w $+ ay
    }
    %r = %r $iif($prop == cap,$upper($mid(%w,1,1)) $+ $right(%w,-1),%w)
    inc %a
  }
  return %r
}

This is not the way I'd go about this at all because it doesn't really follow all of the rules of pig latin...but that wasn't the question. cool


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#3240 24/12/02 04:51 AM
Joined: Dec 2002
Posts: 23
R
R1pl3y Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 23
How so?
Please explain. smile


R¹¶¬³¥
#3241 24/12/02 06:06 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
I really don't think this is the proper place to discuss linguistic theories, do you? :tongue:


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard