RE: [PHP-WIN] random elements of an array

2002-03-26 Thread Svensson, B.A.T. (HKG)
Can you please explain (elaborate) what you mean? >-Original Message- >From: Nicola Delbono >Sent: Tuesday, March 26, 2002 11:12 AM >To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] >Subject: RE: [PHP-WIN] random elements of an array > > >why not shuffle() ? > &

RE: [PHP-WIN] random elements of an array

2002-03-26 Thread Nicola Delbono
// Pic a random element >>> int nRandomPic = nLen * rand(); >>> >>> //Swap current element with the random pic >>> int nTemp = pnElement[nLoop]; >>> pnElement[nLoop] = Element[nRandomPic]; >>> pnElement[nRandomPic] = nTemp;

RE: [PHP-WIN] random elements of an array

2002-03-25 Thread Svensson, B.A.T. (HKG)
Of course the algorithm works... >-Original Message- >From: Nicole Amashta >Sent: Friday, March 22, 2002 4:36 PM >To: [EMAIL PROTECTED] >Subject: Re: [PHP-WIN] random elements of an array > [...] >I have tested this. It works, Even after you refresh the pa

Re: [PHP-WIN] random elements of an array

2002-03-22 Thread Nicole Amashta
ach: > > > > void ScrambleIntList(int *pnElements, int nLen) > > { > > for (nLoop = 0, nLoop > > > // Pic a random element > > int nRandomPic = nLen * rand(); > > > > file://Swap current element with the random pic > > int nTemp

Re: [PHP-WIN] random elements of an array

2002-03-22 Thread Nicole Amashta
>-Original Message- > >From: Afan Pasalic [mailto:[EMAIL PROTECTED]] > >Sent: Thursday, March 21, 2002 9:17 PM > >To: [EMAIL PROTECTED] > >Subject: [PHP-WIN] random elements of an array > > > > > >Hi, > > > >My problem is:

RE: [PHP-WIN] random elements of an array

2002-03-22 Thread Svensson, B.A.T. (HKG)
2002 9:17 PM >To: [EMAIL PROTECTED] >Subject: [PHP-WIN] random elements of an array > > >Hi, > >My problem is: if I have an array (e.g. 1, 2, 3, 4, 5, 6, 7, >8, 9), how I can "shake" the array and get randomized order of >the same array (e.g. 5, 8, 1, 9, 3, 4,

[PHP-WIN] random elements of an array

2002-03-21 Thread Afan Pasalic
Hi, My problem is: if I have an array (e.g. 1, 2, 3, 4, 5, 6, 7, 8, 9), how I can "shake" the array and get randomized order of the same array (e.g. 5, 8, 1, 9, 3, 4, 7, 2, 6)? Thanks for any help! Afan