Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.kindust.NumberSequenceSolver;
- import java.security.SecureRandom;
- import java.util.Arrays;
- /* This program is free for all to use, modify, and share, PROVIDED THAT credit is given to Kindust.com for this program. 7/14/15*/
- public class Main {
- static int n1 = 1, n2 = 0, n3 = 0, n4 = 0, n5 = 0, targ = 0;
- static SecureRandom r;
- static int[] sorted;
- public static void main(String[] args){
- r = new SecureRandom();
- n1 = 1;
- n2 = r.nextInt(2) + 1;
- n3 = r.nextInt(10) + 1;
- n4 = r.nextInt(25) + 1;
- n5 = r.nextInt(300) + 1;
- targ = r.nextInt(100000);
- if(n1 == n2 || n2 == n3 || n3 == n4 || n4 == n5 || n1 == n3 || n1 == n4 || n1 == n5 || n3 == n1 || n3 == n5 || n1 == n3 ||n1 == n5 ||n4 == n2){
- System.out.println();
- System.out.println("Failure to initialize correctly! This is a non-critical error. The bad numbers are listed below. Attempting restart...");
- int[] s1 = { n1, n2, n3, n4, n5 };
- Arrays.sort(s1);
- int[] s2 = { s1[0], s1[1], s1[2], s1[3], s1[4] };
- sorted = s2;
- System.out.println();
- System.out.println(sorted[0] + " " + sorted[1] + " " + sorted[2] + " " + sorted[3] + " " + sorted[4]);
- System.out.println();
- Main.main(null);
- return;
- }
- System.out.println("Program initialized, set to have a maximum target of 100,000. Starting thread...");
- new Thread(new Method1()).start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment