Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Random script issues

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Delusion

New Member
Impact
0
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:
<?
echo "<table>";
 for($i=1 , $c=1 , $b=4 , $a=1 ; $i <= 220 ; $i++ , $c+=1 , $b++, $a++) {

   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"; }
   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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back