IES ACADEMY

IES ACADEMY
research

Translate

Popular Posts

Sign in with your
Google Account
Email:
ex: pat@example.com
Password:
Can't access your account?

Labels

education research blog

researc

researc
AI
Powered By Blogger

Search This Blog

WELCOME LINE

I AM IS NOTHING IN AI
» »Unlabelled » Define player information


TBLOG 5:09 PM 0

find error in this code Fantasy cricket Platform

Fantasy Sports Platform









array( "name" => "Player 1", "runs" => 55, "wickets" => 2, "overs" => 4, "catches" => 1, "runOuts" => 0, "stumpings" => 0 ), "player2" => array( "name" => "Player 2", "runs" => 25, "wickets" => 1, "overs" => 3, "catches" => 0, "runOuts" => 1, "stumpings" => 0 ) ); // Define scoring rules $runsPoints = 1; $wicketPoints = 10; $oversPoints = 2; $catchPoints = 5; $runOutPoints = 5; $stumpingPoints = 5; // Calculate points for each player foreach ($players as $playerId => $playerData) { $totalPoints = 0; // Calculate points for runs $totalPoints += $playerData["runs"] * $runsPoints; // Calculate points for wickets $totalPoints += $playerData["wickets"] * $wicketPoints; // Calculate points for overs $totalPoints += $playerData["overs"] * $oversPoints; // Calculate points for catches $totalPoints += $playerData["catches"] * $catchPoints; // Calculate points for run-outs $totalPoints += $playerData["runOuts"] * $runOutPoints; // Calculate points for stumpings $totalPoints += $playerData["stumpings"] * $stumpingPoints; // Output total points for each player echo "Total points for " . $playerData["name"] . ": " . $totalPoints . PHP_EOL; } ?>

«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply