0
What did i do wrong?
This is my code: https://code.sololearn.com/c4o8NsBKPy2O My problem is i want to check random Chars in the ANoten function . The chars are musicl notes and they have a value. i want to print out the random notes but only if the summ of the notes are less 16. if its more than 16 i want to fill uf the clock with breaks and end the clock with a "|". After the clock ends i want to start a new clock for 7 more times, that i have 8 clocks seperated with "|" Thank you
2 Respuestas
0
In your program everything is working fine but only this method is taking too much time to execute.
ANoten()
You have to analyize it.
To check Just do comment, line number 23 & 29
0
I think, ANoten() function looping more time..
Use equals method to compare strings
Like note. equals("N") ;
== compares type not content... That may me reason I think...
Edit:
By this:
if(t-w >= 0){ // 16-16=0 max, 0-n fails, t=0 only
n = n + note;
t = t - w;
}
}while(t >= 0) ;
t value not becomes negative, hence loop don't going to be terminated.. Check one in this..