OK, so I need to have a script which scrambles words without any double letters. The word has to be inputted by the user. This is what I have so far:
when gf clicked delete [all v] of [Current Name v] delete [all v] of [New Name v] switch to costume [Ask v] go to x: (0) y: (-158) clear ask () and wait set [WordDecompile v] to (0) repeat (length of (answer)) change [WordDecompile v] by (1) add (letter (WordDecompile) of (answer)) to [Current Name v] end switch to costume [] go to x: (100) y: (0) repeat (length of (Current Name)) end repeat (length of [New Name v]) switch to costume (item [1 v] of [New Name v]) stamp move (20) steps delete [1 v] of [New Name v]Please help where the repeat with nothing in it is, PLEASE!
Last edited by Vortex_ (2013-01-12 01:55:50)
Offline
Sorry, I can't help you there, but here's a script that will scramble words as you want (it might inadvertently solve your problem):
when gf clicked set [count v] to [1] set [Scrambled Word v] to [] delete (all v) of [Word v] delete (all v) of [Numbers v] ask [Word to Scramble] and wait repeat (length of (answer)) add (letter (Count) of (answer)) to [Word v] add (Count) to [Numbers v] change [Count v] by (1) end repeat (length of [Numbers v]) set [Random v] to (pick random (1) to (length of [Numbers v])) set [Scrambled Word v] to (join (Scrambled Word)(item(item(Random) of [Numbers v]) of [Word v])) delete (Random) of [Numbers v] end say (Scrambled Word)I've tested this and it works, unless I misunderstood your problem. Hope this helps
Last edited by PhirripSyrrip (2013-01-12 05:15:58)
Offline
I just made a project to help you check out the script. It scrambles any word. I would normally scratch block with your variables but it is late and I think you can figure it out. If not let me know I would be glad to help.
http://scratch.mit.edu/projects/chimoo5/3033336
Offline
chimoo5 wrote:
I just made a project to help you check out the script. It scrambles any word. I would normally scratch block with your variables but it is late and I think you can figure it out. If not let me know I would be glad to help.
http://scratch.mit.edu/projects/chimoo5/3033336
Sorry, but that doesn't work. Among other words, I tried "Cheesegrater" and after ten minutes on turbo mode, I've got nothing. Trust me, my script above works.
Offline
PhirripSyrrip wrote:
Sorry, I can't help you there, but here's a script that will scramble words as you want (it might inadvertently solve your problem):
when gf clicked set [count v] to [1] set [Scrambled Word v] to [] delete (all v) of [Word v] delete (all v) of [Numbers v] ask [Word to Scramble] and wait repeat (length of (answer)) add (letter (Count) of (answer)) to [Word v] add (Count) to [Numbers v] change [Count v] by (1) end repeat (length of [Numbers v]) set [Random v] to (pick random (1) to (length of [Numbers v])) set [Scrambled Word v] to (join (Scrambled Word)(item(item(Random) of [Numbers v]) of [Word v])) delete (Random) of [Numbers v] end say (Scrambled Word)I've tested this and it works, unless I misunderstood your problem. Hope this helps
I can probably put my old scripts into this... Thanks!
Offline