I wrote an applet (its a part of a game) which creates an array contains 1475 elements. at the begginig the user sets a time (15 hours for example) and using the timer class, the array moves to the next element every 250 milliseconds.
After 15 hours the applet returns the index of the array where it stopped.
My problem is that I wanna have another button called "solve" that will give the index of the array where the applet will stop, before that 15 hours. Are there any methods that can help me? and if not, maybe some one can give me a logical explanation how can I do that?
10-10-2005, 09:32 AM
1475 elements, each "stopped at" every 250 ms, that tells me that the end is reached
after appr. 6 minutes, so I guess your algorithm loops back to the start of the array
Can't you just calculate how many ticks the 15 hrs represent and do that in a loop
(without the time delay), it should finish right where your answer is.