Readable Misspeller StuffPlug NG Talker - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Forum: Plug-Ins (/forumdisplay.php?fid=28) +------ Thread: Readable Misspeller StuffPlug NG Talker (/showthread.php?tid=51532) Readable Misspeller StuffPlug NG Talker by Improfane on 10-08-2005 at 10:32 AM
Hello, code: It is having some problems with 3 letter words, I'll figure it out, eventually. [ I haven't visited these forums for a while so here is my response to CookieRevised's post: http://shoutbox.menthix.net/showthread.php?tid=51...d=548567#pid548567 ] I wrote a generic scrambling function that is irrelevant to the talker above. All this does is scramble whatever you feed it. The talker, takes the 2nd letter to the 2nd to last letter and feeds it to the scrambler. Understand? This is why only the middle letters get scrambled. However, I encountered a bug where despite this, the entire 3 letter string would be passed and therefore scrambled: "the" -> "teh" where instead it should be "the" as the "e" has nowhere to move. That's why there isn't anything flawed with the scrambler. I've realised that if it was to be completely modular, the actual talker would be a separate module, named something like "ReadableMispell()" that would itself check the letter length, and inturn call upon the scrambling module. You didn't say that, you said my scrambling routine was broken. Instead, I only used a scrambler routine that I've already written in a previous project. Where the length was irrelevant - it was a password generator I believe. What you are saying would be correct if my scrambler was specific to this project, alas it is not, the check of length would be redundant. If you want to talk efficiency, I understand your point as scrambling twice is pointless when you can simply check length and therefore valid. I didn't realise you meant this. After re-reading this (just checking my Google trail) It doesn't seem to be understood what I mean by modularity. J-Thread wants to remove all the functions and put it as messiness. Cookie didn't need to be an ass about it, either. Explain in English rather than randomly exclaim 'Fix your scrambler' and not tell me how. As far as I'm aware, the word scrambler is not broken. The word one was. I'd rather not tie the the talker and the word randomizer together. I'd rather be able to reuse it later on. Hence the generic word and scrambler functions. The only bug was the making [the] to [teh]. The length check is necessary to fix this unless you put word dependent stuff in the first loop. Cleanliness and readability is my mantra. You can use the scramble function above to mix up any string of characters, for example: a password, scramble("abcdefghijklmnopqrstuvwxyz0123456789").substring(0,8); In hindsight, the word check should probably be in the main loop. RE: Readable Misspeller StuffPlug NG Talker by t1a0s on 10-08-2005 at 11:47 AM Awesome, i really like it Gr8 for annoying people with RE: Readable Misspeller StuffPlug NG Talker by DragonX on 10-08-2005 at 11:54 AM
quote:If yur messing up the middle letters of a word, wouldn't it be normal that u have trouble with a 3 letter word, since there's only 1 letter in the middle ? RE: Readable Misspeller StuffPlug NG Talker by qgroessl on 10-08-2005 at 12:09 PM
quote: haha.... That's what I was thinking... It's that if you have words as long as the first and the last letters are in the right place, you should be able to read them.... I guess I'm not awake enough this morning to get that though... As I really had no clue what you said in your post until you translated it. Anyways... Looks good. RE: Readable Misspeller StuffPlug NG Talker by Impheatus on 10-08-2005 at 02:38 PM
quote:LOL... Well, the 3-letter words would stay exactly the same way, as there is only one variable and it can't switch places to anywhere. RE: Readable Misspeller StuffPlug NG Talker by cardshark on 10-08-2005 at 03:41 PM The only problem with that is the same issue people had with the report in the first place: it is not entirely accurate. There are too many words in the English language that have the same letters that if you are trying to unscramble them, you aren't sure which word you are supposed to read it as, even if you can get it based on the context of the sentence (ie. weird and wired, from and form, etc). RE: Readable Misspeller StuffPlug NG Talker by Improfane on 10-08-2005 at 04:51 PM
Thanks for the replies. RE: Readable Misspeller StuffPlug NG Talker by spokes on 10-08-2005 at 05:44 PM stuffplug comes with this talker...or at least mine did RE: Readable Misspeller StuffPlug NG Talker by prashker on 10-08-2005 at 05:56 PM
quote: teh adn yuo I read those perfectly before RE: Readable Misspeller StuffPlug NG Talker by J-Thread on 10-08-2005 at 10:34 PM
quote: The answer is really obvisious.... But well, i'll help you, here it is. code: RE: Readable Misspeller StuffPlug NG Talker by CookieRevised on 10-08-2005 at 10:38 PM instead of using a workaround and don't allow 3 character words to be scrambled, fix your scrambler routine instead RE: RE: Readable Misspeller StuffPlug NG Talker by Improfane on 10-09-2005 at 12:00 AM
quote: Who are you referring to, the person who added something (J-Thread) or me? It wouldn't be a workaround, if I were to correct my scrambler - it wouldn't fulfull the purpose of it. If you program, you should know that keeping your code modular is important, for that reason I made the scrambler routines separate from the talker. So what he did to correct my code is fine because, he didn't modify the scrambler. If I modifed the scrambler, it means it couldn't be used in another project that might not matter about the input length of 3. I have a philosophy of generic and specific. Generic functions such as scramble, scramble and do only that, while everything else builds upon that to make specification. You build on the foundations. Workarounds are quick and dirty to solve problems with the original code, this isn't it is just a matter of what should be input and not. Thankyou, J-Thread. quote: Really? Oh, I apologise if this has already been done. Do you know what the talker is called? quote: quote:When I was referring to a 3 letter problem, it wasn't that nothing would change because only one letter can move - nowhere, obviously. It was that sometimes when I used "the" as an input it would make "teh". Either it was something irrelevant to this plugin (like on my pc, a plugin) or a bug. "The" should stay as "The" when used with this. quote:These words should stay the same to help the reader understand the gist of the sentence. I'll experiment later with instead of just the first and last letter the same, but sometimes - with long words, the middle letters, the quarter letter and so forth. RE: Readable Misspeller StuffPlug NG Talker by dotNorma on 10-09-2005 at 01:45 AM
if(cur_word_length > 3) { RE: Readable Misspeller StuffPlug NG Talker by TheBlasphemer on 10-09-2005 at 10:58 AM
quote: That's not necesarry If the word has less than 4 letters, scrambling the middle one won't do anything anyway RE: RE: RE: Readable Misspeller StuffPlug NG Talker by CookieRevised on 10-09-2005 at 12:44 PM
quote:That is exactly what I'm talking about and why I call it a workaround... Simply make your scrambler so it doesn't bug out on words less than 4 characters. The scrambler routine should be able to process any word _on its own_, no matter what length, _that_ is modular and generic, not how it currently is.. Using the current scrambler routine in other projects requires you to constantly do a check before parsing the word to the scrambler, in other words that isn't modular at all as you need more special code (the length check) inside the main procedure to let the scrambler routine work decently... If I would use a generic modular code, I'd expect it to work with any input, and without the need of some extra checks before I call the routine... At least move the length check inside the scrambler routine, not inside your main routine. But if you make your scrambler routine more streamlined it wouldn't even need a length check at all... If you wanna make other scramblers, you'll see that the length check is part of the scrambling process, and not part of the main routine, because other scramblers could for example encrypt 2 letter words or what not... Thus replacing the current scrambler routine with such a new one will also require you to modify the main code. Thus, not exactly what I call a "modular" or a "generic" function... |