java - Android App Stops and Crashes when using a long nested loop -


i trying make nested loop show me on screen combinations of letters , numbers, created nested loop make string of 15 characters put in string named "pass". "tr" activity made translate numbers resulted in letters or numbers (something ascii table), thought translate activity problem commented whole thing out leaving loops , app freeze. here code:

  private void nestedlooptest() {             (int aa = a; aa < 35; aa++) {                 (int bb = b; bb < 35; bb++) {                     (int cc = c; cc < 35; cc++) {                         (int dd = d; dd < 35; dd++) {                             (int ee = e; ee < 35; ee++) {                                 (int ff = f; ff < 35; ff++) {                                     (int gg = g; gg < 35; gg++) {                                         (int hh = h; hh < 35; hh++) {                                             (int ii = i; ii < 35; ii++) {                                                 (int jj = j; jj < 35; jj++) {                                                     (int kk = k; kk < 35; kk++) {                                                         (int ll = l; ll < 35; ll++) {                                                             (int mm = m; mm < 35; mm++) {                                                                 (int nn = n; nn < 35; nn++) {                                                                     (int oo = o; oo < 35; oo++) {                                                                         pass = tr                                                                                 .translate(aa)                                                                                 + tr.translate(bb)                                                                                 + tr.translate(cc)                                                                                 + tr.translate(dd)                                                                                 + tr.translate(ee)                                                                                 + tr.translate(ff)                                                                                 + tr.translate(gg)                                                                                 + tr.translate(hh)                                                                                 + tr.translate(ii)                                                                                 + tr.translate(jj)                                                                                 + tr.translate(kk)                                                                                 + tr.translate(ll)                                                                                 + tr.translate(mm)                                                                                 + tr.translate(nn)                                                                                 + tr.translate(oo);                                                                         passtxt.settext(pass);                                                                     }                                                                 }                                                             }                                                         }                                                     }                                                 }                                             }                                         }                                     }                                 }                             }                         }                     }                 }             }         } 

how can solve ? edit: app freezes 10mins , after display last generated string, how can make code show every string , pause ?

you realize have o(35^m) m = # of loops have. not desktop computer can handle many operations. don't understand you're trying do, should come better algorithm.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -