-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random word replacement #3
Random word replacement #3
Conversation
This is awesome! |
I'm going to take a look at this over the weekend. Thanks for the PR |
//set it back to zero | ||
randomNumber = 0; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it looks like I forgot to actually set the random number to the last selected random number before returning. Looking at this today this could likely be cleaned up a little.
@ferventcoder You might update this to use https://github.com/jpoehls/node-randomSelection (or at least the logic from it) so that the replacement words are randomly used without being repeated more times than is necessary. |
I still haven't had a chance to check this out, but I "will" get to it. |
It's all good (I'm slow at getting to pull requests most of the time). Here's the fix I was looking to get in. |
Took a quick look at this. I think "repeat" needs to be a more descriptive variable name. I already have a repeat prototype, and it "could" be confusing. Might also want to enable I might tinker a little... but overall, it's good. |
Thanks. Agreed on repeat. :D |
Following back up on this, did you want me to make the changes and update the PR or were you taking it from here? :) |
I finally had an opportunity to test this. It works great with edit - hang on, I'm thinking a bit on this. |
Ok, so on further investigation... I "think" I got this. If I still want to change the name from I think I'm gonna work on this tonight a bit and see what I come up with. |
Awesome! |
Ok, so I didn't merge the pull request, but I took your concept and enhanced it a bit. I basically removed the "repeat" and did some type checking. Take a look and see what you think. |
Looks good to me. :D Glad to see this feature make it in. Now if you could just support regexes, this would be awesome! ;) |
The next step is going to enable l33k speak. The concept I'm going to try is to take the basic list of phrases here is a good one for example and then run them through a regex replacing things like "e" with "3" and adding the new variations on the words to the array stored in I really want to avoid running any phrases through a regex every time the method is called, since it's going to slow everything down dramatically. |
This adds the ability to use random word replacement against a set of swear words. If you don't want it to be random, just provide one word.
This adds to the fun by taking the bad words and cleaning them up into more fun words!
Could result in: