0% found this document useful (0 votes)
1 views1 page

HTML Index

The document is an HTML code for a simple game called 'P999 Simple Game'. Players can increase their score by clicking the 'Play' button, which randomly determines whether they win or lose points. The game also includes a 'Reset' button to set the score back to zero.

Uploaded by

mhassanraja2000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views1 page

HTML Index

The document is an HTML code for a simple game called 'P999 Simple Game'. Players can increase their score by clicking the 'Play' button, which randomly determines whether they win or lose points. The game also includes a 'Reset' button to set the score back to zero.

Uploaded by

mhassanraja2000
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<!

DOCTYPE html>
<html>
<head>
<title>P999 Style Game</title>
<style>
body {
text-align: center;
font-family: Arial;
background: #111;
color: white;
}
button {
padding: 15px 25px;
font-size: 18px;
margin: 10px;
cursor: pointer;
}
</style>
</head>

<body>

<h1>P999 Simple Game 🎮</h1>


<p>Click to increase score!</p>

<h2 id="score">Score: 0</h2>

<button onclick="playGame()">Play</button>
<button onclick="resetGame()">Reset</button>

<script>
let score = 0;

function playGame() {
let random = [Link]([Link]() * 10) + 1;

if (random > 5) {
score += 10;
alert("You win! +" + 10);
} else {
score -= 5;
alert("You lose! -5");
}

[Link]("score").innerText = "Score: " + score;


}

function resetGame() {
score = 0;
[Link]("score").innerText = "Score: 0";
}
</script>

</body>
</html>

You might also like