You havent really given all the needed information to allow a script to be created, basicly becuase your examples dont match.
And you left it up to us to look at them and try and interprut what you wanted, I made a mistake and thought you wanted
hint 1 being all * and spaces
hint2 being each words first letter * and spaces
hint3 being an undetermined number of random extra letters revealed
^ I called this METHOD1
After writting code to do the above I looked a little closer and it appears you want
hint 1 being all * and spaces
hint2 being each words first letter * and spaces
hint3 being 1 random letter per word revealed , unless there is only one * left then do nothing on that word
^ I called this METHOD2
Since the second method used the code from the first one with some changes, and I like the first one better anyway, Im posting both.
As we cant know how your bot works or under what timing or conditions you release a hint, I have simply created an $identifier that returns the next hint
Usage is as follows...
var %thishint = $hint.methodx(<the answer>,<last hint>)
* if you only pass <the answer> then it well return a * and spaces representation of it
* if you pass it the last returned value it returns the next one
* if you pass it junk its going to pass you junk back!
simple example
//echo -a $hint.method1(This Is a Test)
**** ** * ****
//echo -a $hint.method1(This Is a Test,**** ** * ****)
T*** I* a T***
//echo -a $hint.method1(This Is a Test,T*** I* a T***)
T*** I* a T*s*
//echo -a $hint.method1(This Is a Test,T*** I* a T*s*)
Th** I* a T*s*
//echo -a $hint.method1(This Is a Test,Th** I* a T*s*)
Th*s I* a T*s*
etc etc
simple example
//echo -a $hint.method2(This Is a Test)
**** ** * ****
//echo -a $hint.method2(This Is a Test,**** ** * ****)
T*** I* a T***
//echo -a $hint.method2(This Is a Test,T*** I* a T***)
T*i* I* a T*s*
//echo -a $hint.method2(This Is a Test,T*i* I* a T*s*)
T*is I* a Tes*
//echo -a $hint.method2(This Is a Test,T*is I* a Tes*)
T*is I* a Tes*
same as aboveSo you need to pass it the answer and rember what it returns wheather you use method1 (mine) or method2 (yours)
I have supplied an actual example alias to allow you to see how it works, and the results, your method of number or repetitions and mine may vary.
BE ADVISED DO NOT always expect the last hint of method 1 to match the passed <the answer> text. 99% of the time it well, but due to the use of tokens it is possable for extra spaces to have been erased.
alias hint.method1 {
var %answer = $gettok($1,1-,32)
var %hint = $gettok($2,1-,32)
if (!%hint) {
!.echo -q $regsub(%answer,/[^ ]/g,*,%hint)
}
elseif ($regex(%hint,/^[* ]+$/iS)) {
var %i = $numtok(%hint,32)
while (%i) {
var %hint = $puttok(%hint,$+($left($gettok(%answer,%i,32),1),$mid($gettok(%hint,%i,32),2)),%i,32)
dec %i
}
}
elseif ($pos(%hint,*,0)) {
var %pos = $pos(%hint,*,$rand(1,$v1))
var %hint = $+($left(%hint,$calc(%pos - 1)),$mid(%answer,%pos,1),$mid(%hint,$calc(%pos + 1)))
}
return %hint
}
;
alias hint.method2 {
var %answer = $gettok($1,1-,32)
var %hint = $gettok($2,1-,32)
if (!%hint) {
!.echo -q $regsub(%answer,/[^ ]/g,*,%hint)
}
elseif ($regex(%hint,/^[* ]+$/iS)) {
var %i = $numtok(%hint,32)
while (%i) {
var %hint = $puttok(%hint,$+($left($gettok(%answer,%i,32),1),$mid($gettok(%hint,%i,32),2)),%i,32)
dec %i
}
}
elseif ($pos(%hint,*,0)) {
var %i = $numtok(%hint,32)
while (%i) {
var %hword = $gettok(%hint,%i,32)
if ($pos(%hword,*,0) > 1) {
var %pos = $pos(%hword,*,$rand(1,$v1))
var %hint = $puttok(%hint,$+($left(%hword,$calc(%pos - 1)),$mid($gettok(%answer,%i,32),%pos,1),$mid(%hword,$calc(%pos + 1))),%i,32)
}
dec %i
}
}
return %hint
}
;
;
;
;
alias example {
var %answer = $$gettok($remove($1-,*),1-,32)
var %hint
var %c = 1
while (%hint != %answer) {
var %oldhint = %hint
var %hint = $hint.method1(%answer,%hint)
echo -s Hint2 : %c : %answer : %hint
inc %c
}
;
echo -s ----
;
var %answer = $gettok($remove($1-,*),1-,32)
var %hint
var %oldhint = .
var %c = 1
while (%hint != %oldhint) {
var %oldhint = %hint
var %hint = $hint.method2(%answer,%hint)
echo -s Hint1 : %c : %answer : %hint
inc %c
}
}