Questions and Answers

How do I collect points?

  • +5
    Chosen as best answer
  • +1
    Posted answer
  • +1
    Posted question
  • +1
    Thumb up
  • -1
    Thumb down
2

by realbuzzet in Challenge Help about November 4, 2017 open - report

Basic 14, JS 11 (Spoiler)

I know the Problem and I try to solve it with a Brute Force like method.

I wrote an Java Programm which does the calculation for me. But it won't find the right answer...

Do i miss somethink or do I just have to wait that it finised someday in the future?

Programm: 

String charlist = "abcdefghijklmnopqrstuvwxyz";
String pass = "";
int charNb = 0;
long i = 248410397744610L;
int durchläufe = 1;
while( i != 0 ){
   while ( (i - charNb + 1) % 17 != 0 ){
      charNb = (int) Math.floor(Math.random() * (charlist.length() - 1));
   }
   charNb++;
   i = i - charNb;

   if(i < 0){
   i = 248410397744610L;
   runs += 1;
   System.out.println("Run Nb: " + runs);
   }
   i = i / 17;
   pass = pass + charlist.charAt(charNb);
   charNb = 0;

   pass = "";
}
System.out.println("Pw: " + pass);

No answers yet. Be the first!
You must login to post an answer.