viewing paste Unknown #15803 | Java

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
package main;
 
import java.util.Random;
import java.util.Scanner;
 
import javax.swing.JOptionPane;
 
public class main {
    
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        Random rm = new Random();
        int rate = 2;
        double sday = 1000000000*rate; //player ca 100, 10.000.000 * 100, 
        int xday  = 1000000000*rate;//rm.nextInt(1000000) + 500000;
        double inf = 0;
        int b, c;
        double a;
        System.out.println("How many Days do you want to simulate?");
        int rounds = Integer.parseInt(sc.next());
        System.out.println("How many Option do you want to show?");
        int options = Integer.parseInt(sc.next());
        System.out.println("Money: " + xday);
        for(int i = 0; i < rounds ; i++){
            int WhitePotion = 1200*rate;
            inf = (xday/sday);
            a = rm.nextInt(120000*rate);
            if(inf > 1){
                a = a / (Math.exp(inf));
            }
            //System.out.println(inf + ":" + xday + "/" + sday);
            xday = (int) (xday + (a - (c = ((b = rm.nextInt(100)) * WhitePotion))));
            switch(options){
            case 1:
                System.out.println("Inf Value: " + inf); //+ " : a:" + a);
                break;
            case 2:
                System.out.println("WhitePotion costs: " + WhitePotion);
                break;
            case 3:
                System.out.println("Bought " + b + " WhitePotions" );
                break;
            case 4:
                System.out.println("Money on Server: " + xday);
                break;
            case 5:
                System.out.println("Debug Values: " + xday + " : " + a + " : " + c);
                break;
            default:
                System.out.println("Inf Value: " + inf);
                System.out.println("WhitePotion costs: " + WhitePotion);
                System.out.println("Bought " + b + " WhitePotions" );
                System.out.println("Money on Server: " + xday);
                System.out.println("Debug Values: " + xday + " : " + a + " : " + c);
                System.out.println("---------------------------");
                break;
            }
            
        }
    }
}
 
Viewed 601 times, submitted by Guest.