NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Random script issues

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 01-10-2004, 04:54 AM THREAD STARTER               #1 (permalink)
First Time Poster!
Join Date: Jan 2004
Posts: 1
Delusion is an unknown quantity at this point
 



Random script issues


Hello,

Generally, I'll describe what was my idea at first.

I've been trying to make a script for my school (football, 1vs1) that will make me random teams selection.

The main idea about it, I got 11 teams, The random I was trying to do:

Each team should play 20 games in a season, with each team playing each other TWICE at a season.

I've tried to make this using a 'FOR' loops but I've got double games and alot of mess.

Here's my try:
PHP Code:
<?
echo "<table>";
 for(
$i=$c=$b=$a=$i <= 220 $i++ , $c+=$b++, $a++) {
????: NamePros.com http://www.namepros.com/programming/16978-random-script-issues.html

   echo 
"<tr>";
     echo 
"<td width='100' align='left'>$i</td>";
     echo 
"<td>team $a</td>";
     echo 
"<td>vs.</td>";
     echo 
"<td>team $b</td>";
   echo 
"</tr>";

  
// Storing the DATA at MySQL irrelevant now

   
if ($a >= "11") { $a "0"; }
????: NamePros.com http://www.namepros.com/showthread.php?t=16978
   if (
$b >= "11") { $b "0"; }
   if (
$c >= "6") { $c "0"; echo "<tr><td colspan='5'><hr></td></tr>"; }
 }

echo 
"</table>";
I've spent alot of time trying to make it work and failed
I hope someone around will be able helping me!

Thanks in advnace.
Delusion is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:09 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger