
-----------------------------------
michael_li13
Tue Jan 24, 2006 5:48 pm

Random Play CD
-----------------------------------
I already posted a question like this, but it was a subcategory so alot of people probably didn't see it.  I need to play a CD on random with Turing without replaying tracks and stopping the CD when it's finished.  Could someone tell me how to do this in more detail than just use an array, or check the tutorials.  Please show an example in code.  PLZ help!!!!!

-----------------------------------
iker
Tue Jan 24, 2006 6:44 pm


-----------------------------------
lets say the cd has 12 tracks

var playtrack : int 
var track : array 1 .. 12 of boolean
var trackstring : string
for i : 1 .. 12
    track (i) := false
end for
loop
    loop
        randint (playtrack, 1, 12)
        if track (playtrack) = false then
            track (playtrack) := true
            exit
        end if
    end loop
    trackstring := intstr (playtrack)
    Music.PlayFile ("cd:" + trackstring) 
end loop


there you go, a program that should randomly play all tracks ONCE. If you want to make it play over or have a different amount of tracks then make some adjustments.
if it doesn't work, then i'm sorry[/i]

-----------------------------------
michael_li13
Tue Jan 24, 2006 7:07 pm

Thanks!!!
-----------------------------------
You are a god.  Thanks so much, I've been looking for days (unbelievable eh?)!

-----------------------------------
iker
Tue Jan 24, 2006 7:20 pm

Re: Thanks!!!
-----------------------------------
You are a god.  Thanks so much, I've been looking for days (unbelievable eh?)!

wouldn't say a god, just someone who has knowledge in turing... But don't you be expecting for someone to swoop in and tell you everything or do your programs for you all the time on this website. I only did that because it is an EXTREMELY easy concept, and didn't think theres any way of giving just an example...
please feel free to prove me wrong now, please
