Twist_of_Fate Posted February 20, 2010 Report Share Posted February 20, 2010 Below is the code (i didnt make) that is in the frenzy file to scramble a frenzy word. The problem i am having is if you look you will see %x is less than or equal to 12. so in essense that should allow any words that are 12 or less letters. I want to change it to 15 or less, but what is happening is if its less letters than the number than it will show in the room the scrambled letters with numbers. and example would be(and this is with the code below) say the word is bobblehead it will show it scrambled as lebab2dbbe9o. i placed the whole thing in here in case im missing something. Basically what im asking is how can i get this so it will scramble 10 to 15 letter words with no numbers being shown as i showed in my example. CODE alias scrambleWFword { set %WF.Word $read(TEXT\10letters.txt) window -h @WFScramble var %x = 1, %y = 1,%WF.ScrambleWord while (%x <= 12) { aline @WFScramble $mid(%WF.Word,%x,1) $rand(1,1000) inc %x } filter -wwcteu 2 32 @WFScramble @WFScramble while ($line(@WFScramble,%y)) { var %WF.ScrambleWord %WF.ScrambleWord $+ $gettok($ifmatch,1,32) inc %y } window -c @WFScramble set %UNSWF.Word %WF.Word set %WF.Word %WF.ScrambleWord if ($isid) { return %WF.Word } Link to comment Share on other sites More sharing options...
err0r Posted February 20, 2010 Report Share Posted February 20, 2010 why not use $len and use a percentage of that amount or even just a simple $calc of the $len of the word Link to comment Share on other sites More sharing options...
Twist_of_Fate Posted February 21, 2010 Author Report Share Posted February 21, 2010 Thanks error ill try that. greatly apprecated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now