2YHIXVBTSOXZ3IIQUAJJMYPFEJRIKHA6FF4GP6EWDMD5TW77BCXAC
47FQFDICPYKTV3CK46P6EHPXTN4C3LHFR2AYLEINJ4CUPCZM53AQC
TRS7SAYUPYC3GHIKHBBSRYW4CUNKEJVX4OHLCMNDHXOKUTNP345AC
XAKVBFNCOTJQDRXBAP7ATSPIWYTEROYW3DCJYIGTYFVVLET2RU6QC
OPI6W7BO4V3R5WGEVN4USOHVPUV5PVWGKYBMCRU4VQOI7F7RCF5QC
2KCPYEJPVD4GH2WZIVQY5MY6DSVHGQ2IOZ3V7WQ5Q267B4L6KBUQC
V5OW3Q4IOFG5YIRAWE7J3HDTEBOX2EW7AHVHKFH2XG7I2XXH6SMAC
5I4UCQOTFNIXNO3IEJBPOHAHI63WOS7ZCOGHWJ47IK6MDJ6CBW6AC
ISWDRBPZCEGJSXNXHML7D7XDW4N3Z7MXOF4OS7UHC6U2GVXFHYZQC
JGGVCPUZDY2ZU6EZ72YHJSQKBIOYZPLGWHAJIMSH5ZN3WBWDKJWQC
KVOQMFQTLWL2OLWVEQ7YDKLPXR2H6LV2CCQT4LM6DDTWSLMZS5WAC
ZXBDOUETFSXTFY6J5LIMXBCNMDW6NTUTZ7HZZ6ND7BNUKISR74FAC
}
/** Return the `player_id` of the player that is start player in the given
* mini-game. */
function getStartPlayerId($minigame)
{
$start_player_no = $this->getStartPlayerNo($minigame);
$sql = "SELECT player_id FROM player WHERE player_no = $start_player_no";
return self::getUniqueValueFromDB($sql);
// A round (within this minigame) is over if the (potential) next player
// has `player_no` == current minigame number.
$player_after_id = self::getPlayerAfter($active_player_id);
$sql = "SELECT player_no FROM player WHERE player_id = $player_after_id";
$round_over = self::getUniqueValueFromDB($sql) == $minigame;
// Look for the next 'unsolved' player to activate. If we get to (or
// skip over) the current mini-game's start player, then the current
// round is over.
$round_over = false;
$start_player_id = $this->getStartPlayerId($minigame);
$next_player_id = $active_player_id;
do {
$next_player_id = self::getPlayerAfter($next_player_id);
if ($round_over || $next_player_id == $start_player_id) $round_over = true;
} while (!in_array($next_player_id, $unsolved_player_ids));