RE: [PHP] Randomizing 3 different numbers.

2003-10-27 Thread Tom
Just to give you something to chew on, try the code below. It is slightly more generic, and you can change things a little without having to modify a whole bunch of if() statements. -Original Message- From: Ian Gray [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 12:26 To: [EMAIL PROTE

Re: [PHP] Randomizing 3 different numbers.

2003-10-27 Thread DvDmanDT
Dont you mean || at the last loop? You loop as long as 3 is equal to both 1 and 2, || would cause it to loop while it's equal to any of them.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen

RE: [PHP] Randomizing 3 different numbers.

2003-10-27 Thread Joachim
03 15:56 To: [EMAIL PROTECTED] Subject: Re: [PHP] Randomizing 3 different numbers. Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $on

Re: [PHP] Randomizing 3 different numbers.

2003-10-27 Thread Ray Hunter
Before you add a number to a string make sure that the number is not in any of the other ones if they exist. Use a do-while loop on it... $one = rand( 1,20 ); do { $two = rand( 1, 20 ); }while( $two == $one ); do { $three = rand( 1, 20 ); }while( ($three == $one) && ($three == $two) ); echo