標題: 預算賽電腦抽籤代碼公告 [打印本頁]
作者: 龍之振雄 時間: 2010-7-10 00:05 標題: 預算賽電腦抽籤代碼公告
未表公正先公開抽籤關鍵程式代碼複製內容到剪貼板
代碼:
$count = 0;
srand((float) microtime() * 10000000);
while(count($team_list))
{
$team_a = NULL;
$team_b = NULL;
$index = array_rand($team_list);
$team_a = $team_list[$index];
unset($team_list[$index]);
if($team_a==3 || $team_a==20 || $team_a==27 || $team_a==24) // 四隊種仔隊不用打預選直到16強
{
$team_b = 0;
$query = sprintf('INSERT INTO game_nob5_team_pair (step,num_team,num_round,teams,regdate) VALUES (%d, 2, 3, "%s", "%s")',
$step,
$team_a.','.$team_b,
date("y-m-d H:i:s")
);
mysql_query($query, $sql);
$count++;
continue;
}
if(count($team_list) == 0)
{
$team_b = 0; // 單數隊, 不戰勝
}
else
{
$index = array_rand($team_list);
$team_b = $team_list[$index];
unset($team_list[$index]);
}
$team_n = 0;
if($team_a > $team_b)
{
$team_n = $team_a;
$team_a = $team_b;
$team_b = $team_n;
}
if($team_a==18 && $team_b==45) //避開分隊
{
array_push($team_list, $team_a);
array_push($team_list, $team_b);
continue;
}
if($team_a==27 && $team_b==28) //避開分隊
{
array_push($team_list, $team_a);
array_push($team_list, $team_b);
continue;
}
if($team_a==11 && $team_b==49) //避開分隊
{
array_push($team_list, $team_a);
array_push($team_list, $team_b);
continue;
}
if($team_a==16 && $team_b==26) //避開分隊
{
array_push($team_list, $team_a);
array_push($team_list, $team_b);
continue;
}
if($team_a==40 && $team_b==49) //避開分隊
{
array_push($team_list, $team_a);
array_push($team_list, $team_b);
continue;
}
$query = sprintf('INSERT INTO game_nob5_team_pair (step,num_team,num_round,teams,regdate) VALUES (%d, 2, 3, "%s", "%s")',
$step,
$team_a.','.$team_b,
date("y-m-d H:i:s")
);
mysql_query($query, $sql);
$count++;
}
作者: KAKA_GoD 時間: 2010-7-10 00:06
姐係點????????????
作者: §離′別、 時間: 2010-7-10 00:07
拿拿林抽好過啦..
作者: 小刺蛋 時間: 2010-7-10 00:07
我地要抽籤結果not 代碼
作者: KaIHaNg 時間: 2010-7-10 00:08
唔識電腦都人都唔會明呢d野up乜啦:
作者: KAKA_GoD 時間: 2010-7-10 00:08
=.= sad 龍大哥
姐係咁
好多人 已經 好心急
作者: kh709394 時間: 2010-7-10 00:09
效率好慢=.=講明12點
作者: KAKA_GoD 時間: 2010-7-10 00:10
唔係話慢唔慢
人地等左咁耐
你公佈d 咁既野=.=
人地 一心諗住 有野睇
點知
你開d咁既野
so sad
作者: 您真識食 時間: 2010-7-10 00:12
都唔守時既
又話12點前
作者: 小刺蛋 時間: 2010-7-10 00:13
請不要引起公憤
作者: 『幹』軒轅 時間: 2010-7-10 00:52
電腦始終都係計算..
真正既隨意抽取好似係4月美國科學家先實驗緊(即沒有任可計算方式)
可能過左幾個月..我知道既野落後左...
都有可能係龍大超越左佢地...(今年Nobel是你的)
始終都係人手抽最有驚喜.......
歡迎光臨 IPvE vLan 遊戲平台|網吧系統 (https://ipve.com/bbs/) |
Powered by Discuz! 6.0.0 |