Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var text = msg.content.split(" ").slice(1,2).join(" ");
- var i;
- var textout = "";
- var scramble = [];
- for (i = 0; i < text.length; i++) {
- scramble.push(text.charAt(i))
- }
- scramble.sort(function(a, b){return 0.5 - Math.random()});
- for (i = 0; i < scramble.length; i++) {
- textout = textout + scramble[i]
- }
- while (textout == text) {
- textout = "";
- scramble.sort(function(a, b){return 0.5 - Math.random()});
- for (i = 0; i < scramble.length; i++) {
- textout = textout + scramble[i]
- }
- }
- this.storeValue(textout,1,"textout",cache)
- this.storeValue(text,2,"answer",cache)
- msg.channel.send("Guess the word" + textout)
Advertisement
Add Comment
Please, Sign In to add comment