Finále ROBOSOUTĚŽE 2010

$i) { $table=explode(";", $row[$i]); if ( $table[1] == false ) { return $table[0]." versus ".$table[2]; } $i++; } $fp = fopen("2010_spider.csv", "r"); $contents = stream_get_contents($fp); fclose($fp); $row = explode("\n", $contents); $i=0; while (count($row)-1 > $i) { $table=explode(";", $row[$i]); if ( $table[1] == false ) { return $table[0]." versus ".$table[2]; } $i++; } } $zapas=aktualni_zapas(); if ( $zapas ) { echo "

".$MATCH[$_SESSION['lang']]." : ".$zapas."

"; } ?> $i) { $table=explode(";", $row[$i]); // vytvoření pole pro jednotlivé týmy switch ($i) { case ( $i == 0 ): $team_group="A"; $team_group_number=1; break; case ( $i > 0 && $i < 5 ): $team_group="A"; $team_group_number=$i+1; break; case ( 4 < $i && $i < 10 ): //echo $i; $team_group="B"; $team_group_number=$i+1-5; break; case ( 9 < $i && $i < 15): $team_group="C"; $team_group_number=$i+1-10; break; case (14 < $i && $i < 20): $team_group="D"; $team_group_number=$i+1-15; break; } $team[$team_group][$team_group_number]['number']=$table[0]; $team[$team_group][$team_group_number]['vario']=$table[1]; $team[$team_group][$team_group_number]['name']=$table[2]; $team[$team_group][$team_group_number]['order']=$table[4]; $spider[trim($team_group.$table[4])]=$table[2]; $team[$team_group][$team_group_number]['score']=0.0; $team[$team_group][$team_group_number]['code']=$team_group.$team_group_number; // zjištění aktuálního skóre $as = fopen("2010_matches.csv", "r"); $contents_score = stream_get_contents($as); fclose($as); $row_score = explode("\n", $contents_score); // 1, vybrat řádky na kterých se vyskytuje kód týmu $z=0; while (count($row_score) > $z) { $score=substr($row_score[$z],3,1); //echo $row_score[$z]."
"; //echo $score."
"; if (strpos($row_score[$z], $team[$team_group][$team_group_number]['code']) === false) { next; } elseif (strpos($row_score[$z], $team[$team_group][$team_group_number]['code']) > 1) { switch ($score) { case "<": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+2.0; break; case ">": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']; break; case "(": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+1.5; break; case ")": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+0.5; break; case "=": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+1.0; break; default: $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']; break; } } else { switch ($score) { case "<": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']; break; case ">": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+2.0; break; case "(": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+0.5; break; case ")": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+1.5; break; case "=": $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']+1.0; break; default: $team[$team_group][$team_group_number]['score']=$team[$team_group][$team_group_number]['score']; break; } } $z++; } // tabulka týmů echo ""; $i++; } ?>

Kód týmu (1 kolo) Název týmu Členové týmu Celkový počet bodů Umístění v rámci skupiny
".$team[$team_group][$team_group_number]['code']." ".$team[$team_group][$team_group_number]['name']." "; $members=explode(",", $table[3]); $y=0; while (count($members) > $y) { $team[$team_group][$team_group_number]['members'][$y]=$members[$y]; echo str_replace(" ", " ", trim($members[$y])); if ($members[$y+1]) { echo ", "; } $y++; } echo " ".$team[$team_group][$team_group_number]['score']." ".$team[$team_group][$team_group_number]['order']."

".$MATCH[$_SESSION['lang']]." : ".$zapas.""; } ?> $z) { if ( strpos($row[$z],$A) === 0 ) { $vysledek = explode(";", $row[$z]); if ( $vysledek[1] === false ) { return ''; } if ( $vysledek[1] === '>' ) { return $A; } elseif ( $vysledek[1] === '<' ) { return $B; } else { return ''; } } $z++; } } function match2 ($A,$B) { $fp = fopen("2010_spider.csv", "r"); $score = stream_get_contents($fp); fclose($fp); $row = explode("\n", $score); // vybrat řádek na kterém se vyskytuje zápas týmů $z=0; while (count($row) > $z) { if ( strpos($row[$z],$A) === 0 ) { $vysledek = explode(";", $row[$z]); if ( $vysledek[1] === false ) { return ''; } if ( $vysledek[1] === '>' ) { return $B; } elseif ( $vysledek[1] === '<' ) { return $A; } else { return ''; } } $z++; } } //echo "

"; //echo match('A1','D4'); //echo match('B2','C3'); //echo match('0','P'); //echo $spider['A1']; //echo "

"; $spider['E']=$spider[match('A1','D4')]; $spider['F']=$spider[match('B2','C3')]; $spider['G']=$spider[match('A2','D3')]; $spider['H']=$spider[match('B1','C4')]; $spider['I']=$spider[match('C1','B4')]; $spider['J']=$spider[match('D2','A3')]; $spider['K']=$spider[match('C2','B3')]; $spider['L']=$spider[match('D1','A4')]; $spider['M']=$spider[match('E','F')]; $spider['N']=$spider[match('G','H')]; $spider['O']=$spider[match('I','J')]; $spider['P']=$spider[match('K','L')]; $spider['Q']=$spider[match('M','N')]; $spider['R']=$spider[match('O','P')]; $spider['S']=$spider[match2('M','N')]; $spider['T']=$spider[match2('O','P')]; $spider['U']=$spider[match('Q','R')]; $spider['V']=$spider[match2('Q','R')]; $spider['W']=$spider[match('S','T')]; $spider['X']=$spider[match2('S','T')]; //echo $spider['Q'][0]; //echo "

"; //print_r($spider); //echo "

"; ?>

A1 -              
  E -            
D4 -              
    M -          
B2 -     Q -        
  F -            
C3 -              
               
A2 -             U - 
první místo
  G -            
D3 -     S -        
    N -          
B1 -             V - 
druhé místo
  H -            
C4 -              
               
C1 -             W - 
třetí místo
  I -            
B4 -              
    O -          
D2 -     R -        
  J -            
A3 -              
              X - 
čtvrté místo
C2 -              
  K -            
B3 -     T -        
    P -          
D1 -              
  L -            
A4 -              

".$MATCH[$_SESSION['lang']]." : ".$zapas.""; } if ( $skryj != "" ) { echo "-->"; } ?>

 

 

Okopírováno z původního webu - pozn.red.