|
Joined: Dec 2002
Posts: 23
Ameglian cow
|
OP
Ameglian cow
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.
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¹¶¬³¥
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
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.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Dec 2002
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2002
Posts: 23 |
How so? Please explain.
R¹¶¬³¥
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
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
|
|
|
|
|