![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| They're all corect. Suggestion: Copy-paste this into JES, fix the path to your mediasources, and try it. Mark Guzdial |
| Notice that we're only setting the targetIndex ONCE, at the beginning. Thereafter, we're only incrementing it. That allows for simply appending each sound to the end. Mark Guzdial |
| Here's the easy way to do question 2: Run the program, and print the length of the sound and the targetIndex. That'll tell you if the targetIndex got all the way to the end. Mark Guzdial |
| You can calculate it, just like what everyone's been describing above. But if you are trying to understand it right now, you can print it to see what the values are. You can also print targetIndex between each loop to see just how far each loop goes into the target. Mark Guzdial |