Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- note = "database is the source with all the text in it";
- note = "input is the argument added by the user";
- note = "namesStrLower is a list of only true names in lowercase";
- upnext = "Split database into individual arrays";
- databases = database.split("######################################################################################");
- namesStr = databases[0];
- names = namesStr.split(";");
- wrongNames = databases[1].split(";");
- categories = databases[2].split(";");
- descriptions = databases[3].split(";");
- upnext = "Generate random number to use for determining the output";
- randomNum = Math.floor(Math.random() * 251);
- upnext = "Check if the input can be found in the lists of true names. If yes then determine the index of that element and use it instead of the random number";
- if(input == ""){}else{
- if(namesStr.indexOf(input) == -1){
- if(namesStrLower.indexOf(input) == -1){}else{
- names1 = namesStrLower.replace(input, "!#");
- names2 = names1.replace(/[^!#;]/g, "");
- randomNum = names2.indexOf("!#");
- }
- }else{
- names1 = namesStr.replace(input, "!#");
- names2 = names1.replace(/[^!#;]/g, "");
- randomNum = names2.indexOf("!#");
- }
- }
- upnext = "Create output and send it";
- output = "```[Name:] " + wrongNames[randomNum] + "``````[Species:] " + categories[randomNum] + "``````[Description:] " + descriptions[randomNum] + "```(Real name: ||" + names[randomNum] + "||)";
- output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement