Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Playing Cd music, skipping songs?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
michael_li13




PostPosted: Sun Jan 22, 2006 5:09 pm   Post subject: Playing Cd music, skipping songs?

1) When playing a CD, is it possible to skip songs?
2) Once a song is stopped, can you restart it?
3) When playing a CD on Random (with the randint function) can you make sure it doesn't replay the same songs?

Plz help asap..... Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Jan 22, 2006 5:24 pm   Post subject: (No subject)

1). Simply specify which track to play.
2). Simply specify which track to play.
3). Create an array specifying which tracks have played, which have not played, and which will play next (a randomized queue).
michael_li13




PostPosted: Sun Jan 22, 2006 6:38 pm   Post subject: problem with specifying track...

i would like for the user to type "play" and "Stop" to start and stop the track and "skip" to skip the track. and i'm kinda of beginner at the arrays thing, could you give an example?
Rasta Fella




PostPosted: Sun Jan 22, 2006 9:05 pm   Post subject: (No subject)

Check the Arrays Tutoriol. Also check Flexible Array Tutoriol all can be found under the Turing Walkthrough.
michael_li13




PostPosted: Mon Jan 23, 2006 5:17 pm   Post subject: arrays...how to not replay songs....can't find connection

I looked through the walkthrough on arrays, and I guess I missed something because I still have no idea what you're talking about. So...is there a way to play a CD random without replaying songs. PLZ write an example!!!
Albrecd




PostPosted: Wed Jan 25, 2006 1:47 pm   Post subject: (No subject)

you could use a randint.

code:
var array : songalreadyplayed 1 .. howevermanysongsthereareontheCD of boolean
var Song := Rand.Int (0, howevermanysongsthereareontheCD)

for i : 1 .. howhowevermanysongsthereareontheCD
songalreadyplayed (i) := false
end for

loop
if songalreadyplayed (Song) = false then
%Play Track acording to Song (which is random)
songalreadyplayed (Song) := true
end if
randint (Song, 0, howevermanysongsthereareontheCD)
end loop
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: