Jump to content

Hello!  I am using java and I want a seed to solve this code instantly. Thanks!

import java.util.Scanner;import java.lang.Math;import java.util.Date;import java.util.Random;public class TexasLotto{public static void main(String [] args){MyUtil.header();Scanner kb = new Scanner (System.in);Random rand = new Random(420);int tex1, tex2, tex3, tex4, tex5, tex6;int my1, my2, my3, my4, my5, my6;int match = 0;int counter = 0;tex1 = rand.nextInt(54) + 1;do{tex2 = rand.nextInt(54) + 1;}while (tex2 == tex1);do{tex3 = rand.nextInt(54) + 1;}while (tex3 == tex2 || tex3 == tex1);do{tex4 = rand.nextInt(54) + 1;}while (tex4 == tex3 || tex4 == tex2 || tex4 == tex1);do{tex5 = rand.nextInt(54) + 1;}while (tex5 == tex4 || tex5 == tex3 || tex5 == tex2 || tex5 == tex1);do{tex6 = rand.nextInt(54) + 1;}while (tex6 == tex5 || tex6 == tex4 || tex6 == tex3 || tex6 == tex2 || tex6 == tex1);System.out.println(tex1 + " " + tex2 + " " + tex3 + " " + tex4 + " " + tex5 + " " + tex6);long begin = System.currentTimeMillis();System.out.println("Begin Time: " + begin);   do{my1 = rand.nextInt(54) + 1;do{my2 = rand.nextInt(54) + 1;}while (my2 == my1);do{my3 = rand.nextInt(54) + 1;}while (my3 == my2 || my3 == my1);do{my4 = rand.nextInt(54) + 1;}while (my4 == my3 || my4 == my2 || my4 == my1);do{my5 = rand.nextInt(54) + 1;}while (my5 == my4 || my5 == my3 || my5 == my2 || my5 == my1);do{my6 = rand.nextInt(54) + 1;}while (my6 == my5 || my6 == my4 || my6 == my3 || my6 == my2 || my6 == my1);        match = 0;        if(my1 == tex1 || my1 == tex2 || my1 == tex3 || my1 == tex4 || my1 == tex5 || my1 == tex6)        {        match = match + 1;        }        if(my2 == tex1 || my2 == tex2 || my2 == tex3 || my2 == tex4 || my2 == tex5 || my2 == tex6)        {        match = match + 1;        }        if(my3 == tex1 || my3 == tex2 || my3 == tex3 || my3 == tex4 || my3 == tex5 || my3 == tex6)        {        match = match + 1;        }        if(my4 == tex1 || my4 == tex2 || my4 == tex3 || my4 == tex4 || my4 == tex5 || my4 == tex6)        {        match = match + 1;        }        if(my5 == tex1 || my5 == tex2 || my5 == tex3 || my5 == tex4 || my5 == tex5 || my5 == tex6)        {        match = match + 1;        }        if(my6 == tex1 || my6 == tex2 || my6 == tex3 || my6 == tex4 || my6 == tex5 || my6 == tex6)        {        match = match + 1;        }        counter++;        }while (match != 6);System.out.println(my1 + " " + my2 + " " + my3 + " " + my4 + " " + my5 + " " + my6);long end = System.currentTimeMillis();System.out.println("End time: " + end);System.out.println("Time Lapsed: " + (end-begin)/1000.0);System.out.println("Counter: " + counter);}}
Edited by prolemur
code tags
Link to comment
https://linustechtips.com/topic/475800-need-a-seed/
Share on other sites

Link to post
Share on other sites

Whats a code tag? I'm still fairly new to programming.

http://linustechtips.com/main/forum-20/announcement-12-please-use-code-tags/

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/475800-need-a-seed/#findComment-6376182
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×