/    Sign up×
Community /Pin to ProfileBookmark

Help with modifying random background music player

I’m wanting to create a music box with enough tracks that the listener won’t get bored. I’ve found a code that will work. I just need to know how I need to modify the code to reflect the total number of tracks.

[CODE]var x=Math.round(Math.random()*9)[/CODE]

That’s the line I need to fix. That goes to the player that’s set to play 10 tracks. I have 55 tracks. What do I change the *9 to?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@penguineauthorMar 01.2005 — Oh! Duh! NEvermind. I figured it out on my own. :p
×

Success!

Help @penguine spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...