What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Random numbers, prevent from being used more than once

Random numbers, prevent from being used more than once
Author: Message:
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: Random numbers, prevent from being used more than once
Hmm, there are probably better ways to do this, but you could possibly do this using a multidimensional array...

I'm not sure how to explain but in my head it makes sense. Basically create an array for all the used lyrics, in which each item is also an array containing the 1) lyric number and 2) number of times a lyric has been generated since that one.

So say you generate lyric number 8, the used lyrics array would contain [8,0]

Then every time you generate another lyric, add it to the usedlyrics array and increment the second array item for all the previously generated ones until they are 10, at which point you can remove the item from the usedlyrics array.

Thus if you generate another lyric (say, number 3), your usedlyrics array would contain [8,1],[3,0].

Then another lyric (say number 9): [8,2],[3,1],[0,9] etc.

Obviously you have to make sure the lyric generated is not already in the usedlyrics array before adding it though =p

Sorry if I'm not making myself clear,  I'm tired and not feeling great but it sounded good in my head :P
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
07-03-2007 10:33 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Random numbers, prevent from being used more than once - by stu on 07-03-2007 at 10:14 PM
RE: Random numbers, prevent from being used more than once - by pollolibredegrasa on 07-03-2007 at 10:33 PM
RE: Random numbers, prevent from being used more than once - by foaly on 07-03-2007 at 10:34 PM
RE: Random numbers, prevent from being used more than once - by roflmao456 on 07-04-2007 at 03:15 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 06:01 AM
RE: Random numbers, prevent from being used more than once - by markee on 07-04-2007 at 02:17 PM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 02:31 PM
RE: Random numbers, prevent from being used more than once - by markee on 07-04-2007 at 02:35 PM
RE: Random numbers, prevent from being used more than once - by foaly on 07-04-2007 at 04:00 PM
RE: Random numbers, prevent from being used more than once - by stu on 07-04-2007 at 04:50 PM
RE: Random numbers, prevent from being used more than once - by roflmao456 on 07-04-2007 at 05:22 PM
RE: Random numbers, prevent from being used more than once - by Volv on 07-04-2007 at 05:47 PM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 12:34 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 12:51 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 12:55 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 01:03 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 01:32 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 01:55 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 02:00 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 02:18 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 02:32 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-05-2007 at 02:45 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 02:51 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:07 AM
RE: Random numbers, prevent from being used more than once - by Volv on 07-05-2007 at 03:11 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:22 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:36 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:45 AM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 03:47 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 03:55 AM
RE: RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 04:23 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 04:30 AM
RE: Random numbers, prevent from being used more than once - by foaly on 07-05-2007 at 10:57 AM
RE: Random numbers, prevent from being used more than once - by stu on 07-05-2007 at 04:59 PM
RE: Random numbers, prevent from being used more than once - by CookieRevised on 07-05-2007 at 11:39 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On