From eb426459388941ca9728147905e9e8325675dfe0 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 3 Jul 2014 02:57:26 +0200 Subject: documentation --- how.php | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/how.php b/how.php index c9359d1..7f2dd96 100644 --- a/how.php +++ b/how.php @@ -1,31 +1,50 @@ = 1; $j--) { - $pos = array_search($j, $positions); - $movement[] = ceil(($pos+1)/2).$lines[$pos%2]; + for ($j = $rounds; $j >= 1; $j--) { // tyle par ruchomych, ile rund + $pos = array_search($j, $positions); // odnajdujemy pary ruchome w kolejności X, X-1, ..., 2, 1 + $movement[] = ceil(($pos+1)/2).$lines[$pos%2]; // i ich pozycję w tablicy $positions tłumaczymy na pozycję na sali (xN/E), tworząc wstęgę rotacji } + // pozostałe pary - z automatu stacjonarne + // kompilujemy strukturę $movements[$id] = [ 'tables' => $tables, 'rounds' => $rounds, @@ -34,6 +53,7 @@ for ($i = 0; $i < count($file); $i++) { 'positions' => $positions ]; } + // segmenty nieparzyste to dane ogólne - liczba rund i stołów else { $matches = []; preg_match('/.*(-\d+).*RUNDY.*?(\d+).*STOLIKI.*/s', $file[$i], $matches); -- cgit v1.2.3