Skip to content

zaidqaiser/Rock-Paper-Scissor-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock-Paper-Scissor-Game

Basic Web Game using HTML5, CSS3, JS

Author

@ZAID

PREVIEW:

1 2

Game Logic

  1. User Makes a Choice:

    • The function starts by noting the user's choice.
  2. Computer Makes a Choice:

    • The computer randomly picks between "rock", "paper", and "scissors".
  3. Check for a Draw:

    • If the user's choice is the same as the computer's choice, the game is a draw and a message indicating this is displayed.
  4. Determine the Winner:

    • If it's not a draw, the function checks which choice beats the other:
      • "Rock" beats "Scissors".
      • "Paper" beats "Rock".
      • "Scissors" beat "Paper".
    • Based on this comparison, it determines whether the user or the computer wins.
  5. Update Scores and Messages:

    • If the user wins, their score is increased by one, and a winning message is displayed.
    • If the computer wins, its score is increased by one, and a losing message is displayed.
  6. Repeat the Process:

    • Event listeners ensure that each time the user makes a choice, the game logic is executed again.

About

Basic Project | Web Game using HTML5, CSS3, JS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors