function doAll() { for ($i = 0; $i < 4; $i++) { getPlayer($i); //get image from player and store in hands array getHand($i); //gets the cards and stores them in hands array } getWinner(); //goes through the hands and chooses a winner drawGame(); //prints all the hands including the winner }
function getWinner($UID) { $ret = explode(', ', $UID); if (count($ret) > 1) { foreach ($ret as $value) { echo getWinner($value) . "<br>"; } } if (preg_match("/^UIC-/", $UID)) { $Member = new Member($UID); if ($Member->getFacebook()) { return "<a href='" . $Member->getFacebook() . "' style='color:#3091BA'>" . $Member->getTotalFullName() . "</a>"; } else { return $Member->getTotalFullName(); } } elseif (count($ret) == 1) { return $UID; } }
function electOrEliminateOne($stv_candidates, $stv_ballots, $committee, $config, $droop, $log) { // determine ONE candidate to elect or eliminate $seats = $config['seats']; if (count($stv_candidates)) { list($winner, $log) = getWinner($stv_candidates, $log); if ($winner->points >= $droop) { list($stv_ballots, $log) = allocateSurplus($stv_ballots, $winner, $droop, $log); $committee[] = $winner; $surplus = $winner->points - $droop; $log['report'] = "added " . $winner->eid . " to committee and distributed surplus of " . $surplus; unset($stv_candidates[$winner->eid]); } else { #nobody has at least droop list($loser, $log) = getLoser($stv_candidates, $stv_ballots, $log); $log['report'] = "removed " . $loser->eid . " from ballot"; unset($stv_candidates[$loser->eid]); $stv_ballots = purgeBallotsOfEid($stv_ballots, $loser->eid); } } list($committee, $log) = autofillCommittee($stv_candidates, $stv_ballots, $committee, $config, $log); return array($stv_candidates, $stv_ballots, $committee, $log); }
</td> </tr> <tr> <td><img src='img/player_4.png'></td> <td><?php displayhand($hand4); ?> </td> <td><?php echo $score4; ?> </td> </tr> <tr> <td colspan=3><?php echo getWinner($scores) . " WINS"; ?> </td> </tr> </table> </div> </body> <footer> <hr> Disclaimer: The information included in this page might not be accurate. It was developed as part of the CST336 class at CSUMB. <br> © <a href="http://hosting.otterlabs.org/zielinskiaustinr/cst336/index.html">Zielinski</a>, 2015 <br><img src="../../img/csumb-logo.png"> </footer> </html>
<?php require_once "../file/access.php"; $id = $_POST['id']; if ($id != null || $id != "") { getWinner($id); }
</th><th><?php echo $Ltime[$lang]; ?> </th> <th><?php echo $L3rd[$lang]; ?> </th><th><?php echo $Ltime[$lang]; ?> </th> </tr> </thead> <tbody> <?php getWinner(); ?> </tbody> </table> </div> </div> <!-- 全結果 --> <div class="tab-pane" id="results_tab"> <div class="panel-group" id="accordion1"> <?php getAllResults(); ?> </div> </div>