Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Archana's AoA Point Decay Calculator
- How To Use:
- Get a program that can run a java file, and copy and paste the following text into that program.
- Next, go to http://my.age-of-aincrad.com/function/full_leaderboard.php, and copy the data there, starting with the 1 at the very beginning (Don't include the text at the top, that's important. Example first line: 1 Konata 101222471 29920) and going to the very last person. Create a text file in the same folder as the program, titled leaderboard.txt (no caps, else there'll be an error) and paste all the info into it.
- Lastly, run the program. It will tell you how fast your multiplier will decrease.
- import java.util.Scanner;
- import java.util.ArrayList;
- import java.io.File;
- import java.io.IOException;
- public class Leaderboard
- {
- public static void main(String[] args) throws IOException{
- int[] placement = new int[999];
- String[] name = new String[999];
- int[] points = new int[999];
- int[] multiplier = new int[999];
- File filename = new File("leaderboard.txt");
- Scanner inFile = new Scanner(filename);
- String line = "";
- String parse = "";
- int index = 0;
- ArrayList<Integer> length = new ArrayList<Integer>();
- boolean test = false;
- while (inFile.hasNextLine()){
- line = inFile.nextLine();
- parse = (line.substring(0,line.indexOf(" ")));
- placement[index] = Integer.parseInt(parse);
- line = line.substring(line.indexOf(" ") + 1);
- name[index] = line.substring(0, line.indexOf(" "));
- line = line.substring(line.indexOf(" ")+1);
- parse = (line.substring(0, line.indexOf(" ")));
- points[index] = Integer.parseInt(parse);
- line = line.substring(line.indexOf(" ")+1);
- multiplier[index] = Integer.parseInt(line);
- index++;
- length.add(points[index]);
- }
- double total = 0;
- for (int index2 = 0; index2 < length.size(); index2++){
- total +=points[index2];
- }
- double average = total/length.size();
- Scanner in = new Scanner(System.in);
- int index3 = 0;
- int choice = 0;
- int importantPosition =0;
- String importantName = "";
- while (true){
- System.out.println("Would you like to know about a name or a position?");
- System.out.println("(1) Name");
- System.out.println("(2) Position");
- choice = in.nextInt();
- if (choice == 1 || choice == 2){
- break;
- } else {
- System.out.println("This was an invalid choice. Please try again.");
- }
- }
- if (choice == 1){
- System.out.println("Enter a name you'd like to know about. Partial names work.");
- importantName = in.next();
- while( index3 < length.size()){
- if (name[index3].contains(importantName)){
- importantName = name[index3];
- break;
- }
- index3++;
- }
- } else if (choice == 2) {
- System.out.println("Enter the position you'd like to know about.");
- while(true){
- if (in.hasNextInt()){
- importantPosition = in.nextInt();
- break;
- } else {
- System.out.println("This is not a valid choice. Try again.");
- }
- }
- index3 = importantPosition - 1;
- importantName = name[index3];
- }
- if (index3 >= length.size()){
- System.out.println("This person could not be found.");
- } else {
- System.out.println("This person's full name is: " + importantName);
- System.out.println("This person's position is: " + (index3+1));
- System.out.println("This person has " + points[index3] + " points");
- System.out.println("This person has a " + multiplier[index3] + " multiplier");
- System.out.printf("This person is subjected to multiplier decay %.2f times faster than the average person. %n", points[index3]/average);
- System.out.printf("This means that this person will begin to lose multiplier after %.2f minutes of inactivity,", 360/(points[index3]/average));
- System.out.printf("%nat a rate of 1 every 30 seconds. The rate of decay will increase by 1 every %.2f minutes.", 360/(points[index3]/average));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement