Dan Becker's Games Site

The Gaming Challenge 2001

The Gaming Challenge 2001 is a record of the games played by several enthusiastic board gamers to play "a game a day" in the year 2001. We all reported our games and goaded each other to exceed the "dreaded black line", the line that signifies playing one game per day. Many of us were successful in reaching this goal. Some exceeded it. In the end we all had a fun time watching who played many games during the year. Here is a list of the games played and a graph of the rate at which we played.

Latest Results

\n"; // DEBUG for ( $playeri = 0; $playeri < count( $team ); $playeri++ ) { $parsedTeamPlayerID = $team[ $playeri ]; if ( strlen( $parsedTeamPlayerID ) == 0 ) echo "DEBUG: Warning, playerIDs " . $playerIDs . " has invalid team format.
\n"; // DEBUG else $playerNames[ $parsedTeamPlayerID ] = ""; } // for } // while // echo "DEBUG: There are " . count( $playerNames ) . " unique playerNames.
\n"; // DEBUG // ksort( $playerNames ); // sort by key // printArray( $playerNames ); //DEBUG $sqlNames = "SELECT PlayerNames.playerid AS playerID, PlayerNames.name AS playerName FROM PlayerNames WHERE PlayerNames.playerid in ( "; $playerCount = 0; while ( list ( $key, $value ) = each( $playerNames )) { if ( $playerCount > 0 ) $sqlNames .= ", $key"; else $sqlNames .= "$key"; $playerCount++; } // while $sqlNames .= " )"; // echo "DEBUG: Player names sql=\"$sqlNames\".
\n"; // DEBUG $sqlNamesResults = sqlQuery( $sqlNames, false ); while ( $data = mysql_fetch_array( $sqlNamesResults, MYSQL_ASSOC )) { $playerID = $data[ "playerID" ]; $playerName = $data[ "playerName" ]; $playerNames[ $playerID ] = $playerName; } // while // printArray( $playerNames ); //DEBUG mysql_data_seek( $sqlResults, 0 ); return $playerNames;} // getPlayerNames// Given a seperated list of player ids, returns a list of playernames.// E.g. converts 123+207+93 to Fred, Bill, Wilma// $playerNames is an assoc. array of ids to names, e.g. array( "101" => "Fred" );// Recall that Scores.playerids may have teams, e.g. 113+306+89function getPlayerList( $playerNames, $playerIDs, $idDelim="+", $listDelim=", " ) { $playerList = ""; $team = explode( $idDelim, $playerIDs ); for ( $playeri = 0; $playeri < count( $team ); $playeri++ ) { $parsedTeamPlayerID = $team[ $playeri ]; $playerName = $playerNames[ $parsedTeamPlayerID ]; if ( strlen( $playerName ) == 0 ) $playerName = ""; if ( $playeri > 0 ) $playerList .= $listDelim . $playerName; else $playerList .= $playerName; } // for each player return $playerList;} // getPlayerNames// Check if an Int value is in the array list.function isIntInList( $list, $values, $valuesDelim="+" ) { if ( !isset( $list ) ) return false; $listSize = sizeof( $list ); if ( $listSize == 0 ) return false; $team = explode( $valuesDelim, $values ); for ( $i = 0; $i < count( team ); $i++ ) { for ( $j = 0; $j < $listSize; $j++ ) { if ( $team[ $i ] == $list[ $j ] ) return true; } } return false;} // isIntInList?>