PHP游戏公式[关闭]

Basically I'm trying my hand at writing a simple football game in PHP. I'm struggling to think how a formula would work for teams to win games.

Lets take for example a team has 11 players each on the pitch and each player can have a maximum rank of 100 therefore a team would have a maximum of 1100xp to have a maxed out football team.

How could I do a PHP formula to determine which team would win or draw? I was thinking to do percentages for a team to win, but I was unsure how I would add a draw in to the formula.

Any help would be appreciated

Your question doesn't make sense as are you developing it as an app "Basically I'm trying my hand at writing a simple football game in PHP". If you're trying to do maths with php, like the team with most exp will win, then its fine. If you know the basics of PHP:

$winner = ($team_1_exp > $team_2_exp ? team1:team2);
return $winner; 

If Probability is required:

$t1 = "team 1 exp points";
$t2 = "team 2 exp points";

$total = $t1 + t2;

$t1 = $t1 / $total * 100; // % amount of chances of winning of team1.
$t2 = $t2 / $total * 100; // % amount of chances of winning of team2.


$winner = ($t1 > $t2 ? team1 : team2);
echo $winner."has more chances of winning this game"; // The probability which team can win!