Skip to content

Exercise creating a rock paper scissors game in JavaScript with randomized choices.

Notifications You must be signed in to change notification settings

Lisonallie/Schaar-Steen-Papier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissors

The rock paper scissors game is playable here.

Why did I make this game? 🗿🗿🗿

This game was assigned to me as an exercise to learn JavaScript.

What were the learning objectives? 📃📃📃

The learning objectives were to learn how to use random in js and generate if statements. I also learned how to use the switch method with cases and how to use a function to capitalize instances of words and replace them in functions.

How did I make the game? ✂️✂️✂️

I followed a nifty tutorial on youtube that showed me how to set up the initial functions I needed. I set the default text and the text for choices of rock, paper, and scissors. I set up a switch statment with different cases to determine who won.

How does the game look and work? 🖥️🖥️🖥️

In terms of CSS, I set up the 3 choices as buttons in a row with a icon of rock paper and scissors inside each respectively, and a reset button underneath. The user clicks on either rock, paper, or scissors and the innerHTML of the welcome message changes based on who won.