Skip to content

Commit

Permalink
fix: disable autoprompt & allow page viewing with game() button
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael "Cal" Krug committed Jan 22, 2024
1 parent a47f493 commit e33fc02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ a:visited {
color: #75507b;
}

button {
background-color: #8f5902;
color: #eeeeec;
border: solid #c17d11 1px;
}

footer p {
color: #d3d7cf;
border-top: dashed #babdb6;
Expand Down
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ <h4>Seeing Program Output</h4>

<h4>Playing</h4>

<p>From this point, it's simply a matter of typing <em>Rock</em>, <em>Paper</em>, or <em>Scissors</em>
<p>From this point, you can click to start the game with the <em>Start Game</em> button.
Then, it's simply a matter of typing <em>Rock</em>, <em>Paper</em>, or <em>Scissors</em>
into the prompt in the webpage, and either clicking <strong>OK</strong> or simply pressing
<strong>ENTER</strong> on your keyboard. The output of the game within your browser's console
will show you the results.</p>

<button type="button" onclick="game()">Start Game</button>

<h4>Restarting the Game</h4>

<p>Simply refresh the page by pressing <strong>F5</strong> on your keyboard, or clicking your
Expand Down
2 changes: 0 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ let npcWeaponChoice;
let userPoint = 0;
let npcPoint = 0;

game();

function game() { // Consists of five rounds, winner is decided based on points

playRound();
Expand Down

0 comments on commit e33fc02

Please sign in to comment.