Nothing fancy, just select a random token from the list
I know it can be done simply using a $gettok(text,$rand(1,$numtok(text,C)),C), but i thought hey whats the harm in asking.
I must admit, I've written that exact line of code before.
alias a.verb { return $gettok($t.verb, $rand(1,$numtok($t.verb,$asc(.))), $asc(.)) }
So... yeah. $randtok(text,C)
Ofcourse I did finally change that script to random read from a file.
Two things:
- He knows that, and even showed how to do it.
- Your solution only gives support for space as a delimiter.
Guess you didn't read Dave's post carefully.
Don't underestimate his work, he managed to convert all "C" from DaveC's post to "32"!
I only ever use 32 with $gettok, anything else and it messes up :P
That happens when you use space as a delimiter.