Advertisement
Index154

nicks

Nov 19th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. note = "allA, allA2 and allB are arrays of words";
  2. note = "id is either 1 or 3, depending on which command was used to call this code";
  3.  
  4. rando = Math.random();
  5. if(rando >= 0.5){AA1 = allA2;}
  6. else{AA1 = allA;}
  7. rando = Math.random();
  8. if(rando >= 0.5){AA2 = allA2;}
  9. else{AA2 = allA;}
  10. rando = Math.random();
  11. if(rando >= 0.5){AA3 = allA2;}
  12. else{AA3 = allA;}
  13.  
  14. if(id == 3){
  15. output = AA1[Math.floor(Math.random() * (AA1.length - 1))] + " " + allB[Math.floor(Math.random() * (allB.length - 1))] + " | " + AA2[Math.floor(Math.random() * (AA2.length - 1))] + " " + allB[Math.floor(Math.random() * (allB.length - 1))] + " | " + AA3[Math.floor(Math.random() * (AA3.length - 1))] + " " + allB[Math.floor(Math.random() * (allB.length - 1))];
  16. }
  17. else{
  18. output = AA1[Math.floor(Math.random() * (AA1.length - 1))] + " " + allB[Math.floor(Math.random() * (allB.length - 1))];
  19. }
  20.  
  21. output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement