A classic game of Rock, Paper, Scissors against a simple computer. I began with a console-only version then later refactored my code to work with a simple UI.
Some of the new lessons I learned include:
- Using the viewport meta tag to enable media query usage
- Integrate web fonts
- Create responsive design for smaller screens
- Use media queries to set breakpoints in which layout should be adjusted
- Use JavaScript methods to manipulate the site's DOM
- Use event listeners to run functions based on user input
- Target element on which event listener was fired
- Refactor code previously written to expand functionality
- Use a vector graphics editor (Inkscape) to modify artwork (in accordance with the licensing terms) and convert to PNG format for web use
Some of the techniques I learned while working on the console-only version were:
- Planning my program prior to coding
- Differentiating between constants and let variables
- Creating a simple array
- Creating a random number generator
- Using Math.floor() to round down and give equal chances of generating random numbers starting at 0, and ending at specified number
- Using Math.random() and a parameter to define number range
- Using AND, OR and NOT logical operators
- Creating if & if else statements
- Passing in arguments to a function
- Using strict equal to in order to check for type and value equality