Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.Scanner;
- public class PRD {
- public static int rngCounter()
- {
- int a;
- Random rand = new Random();
- a = rand.nextInt(99);
- return a;
- }
- public static int chance(){
- int chance = 0;
- Scanner sc = new Scanner(System.in);
- System.out.println("====================================");
- System.out.println("Welcome to Dota 2 RNG Simulator v0.3");
- System.out.println("====================================");
- System.out.println();
- System.out.println("Available skills: ");
- System.out.println("-----------------------------------------------------------------");
- System.out.println("1. Axe - Counter Helix (20%)");
- System.out.println("2. Chaos Knight - Chaos Strike (10%)");
- System.out.println("3. Lycan - Shapeshift Critical (30%)");
- System.out.println("4. Sniper - Headshot (40%)");
- System.out.println("5. Wraith King - Mortal Strike (15%)");
- System.out.println("6. Phantom Assassin - Coup de Grace (15%)");
- System.out.println("7. Troll Warlord - Berserseker's Rage Bash (10%)");
- System.out.println("-----------------------------------------------------------------");
- System.out.println();
- System.out.print("Pick a skill number: ");
- int skill = sc.nextInt();
- if (skill == 1){
- chance = 20;
- } else if (skill == 2 || skill == 7){
- chance = 10;
- } else if (skill == 3){
- chance = 30;
- } else if (skill == 4){
- chance = 40;
- } else if (skill == 5 || skill == 6){
- chance = 15;
- }
- return chance;
- }
- public static void PRD()
- {
- Scanner in = new Scanner(System.in);
- int rngPlease = chance();
- String rngg;
- int[] noprocArray;
- noprocArray = new int[100];
- Integer p;
- int tryCounter = 0;
- boolean randomLagi = true;
- boolean seratus = true;
- while(tryCounter != 100)
- {
- p = rngCounter();
- if(p != null)
- {
- while(randomLagi)
- {
- p = rngCounter();
- for(int i = 0; i < noprocArray.length; i++)
- {
- if(tryCounter == 0)
- {
- break;
- }
- else if(p == noprocArray[i])
- {
- randomLagi = true;
- break;
- }
- else
- {
- noprocArray[i] = p;
- randomLagi = false;
- }
- }
- break;
- }
- if(p < rngPlease)
- {
- System.out.printf("Angka Random: %d\n", p);
- System.out.println("proc");
- noprocArray = new int[100];
- //tryCounter++; siapa tau
- System.out.println("RNGG!");
- System.exit(0);
- }
- else
- {
- System.out.printf("Angka Random: %d\n", p);
- System.out.println("noproc");
- tryCounter++;
- System.out.println("Scrubz, press Enter key to try again...");
- rngg = in.nextLine();
- }
- }
- }
- }
- public static void main(String[] args){
- PRD();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement