Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clonephaze/rockpaperscissors
https://github.com/clonephaze/rockpaperscissors
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/clonephaze/rockpaperscissors
- Owner: Clonephaze
- Created: 2024-01-08T16:29:03.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-10T19:04:35.000Z (10 months ago)
- Last Synced: 2024-01-10T20:25:47.532Z (10 months ago)
- Language: CSS
- Homepage: https://clonephaze.github.io/RockPaperScissors/
- Size: 1.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Frontend Mentor - Rock, Paper, Scissors solution
This is a solution to the [Rock, Paper, Scissors challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/rock-paper-scissors-game-pTgwgvgH). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
## Table of contents
- [Frontend Mentor - Rock, Paper, Scissors solution](#frontend-mentor---rock-paper-scissors-solution)
- [Table of contents](#table-of-contents)
- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screenshot](#screenshot)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)
- [Continued development](#continued-development)
- [Author](#author)## Overview
### The challenge
Users should be able to:
- ✔ View the optimal layout for the game depending on their device's screen size
- ✔ Play Rock, Paper, Scissors against the computer
- ✔ Maintain the state of the score after refreshing the browser _(optional)_
- ✔ **Bonus**: Play Rock, Paper, Scissors, Lizard, Spock against the computer _(optional)_### Screenshot
![](ChallengeCompleteDesktop.png)
![](ChallengeCompleteMobile.png)
### Links
- Solution URL: [Github](https://github.com/Clonephaze/rock-paper-scissors-master)
- Live Site URL: [Github Pages](https://clonephaze.github.io/rock-paper-scissors-master/)## My process
### Built with
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Vanilla JavaScript/HTML/CSS
- [Animista CSS library](https://animista.net/) for CSS animations### What I learned
I learned a lot about Javscript on this one! Which is good, cause that was my entire goal for this project. I watched some videos and looked at some other projects on codepen to see other peoples approach, then smashed things together until it worked right! I think I did a pretty good job actually, like this javascript section:
```js
switch (userChoice + computerChoice) {
case "scissorspaper":
case "paperrock":
case "rocklizard":
case "lizardspock":
case "spockscissors":
case "scissorslizard":
case "paperspock":
case "rockscissors":
case "lizardpaper":
case "spockrock": {
console.log(`You chose ${userChoice} and the computer chose ${computerChoice}`);
choiceMade("win", computerChoice);
}
break;
case "scissorsscissors":
case "paperpaper":
case "rockrock":
case "lizardlizard":
case "spockspock": {
console.log(`You and the computer both chose ${userChoice}`);
choiceMade("tie", computerChoice);
}
break;
default: {
console.log(`You chose ${userChoice} and the computer chose ${computerChoice}`);
choiceMade("lose", computerChoice);
}}
```
I personally think that looks great for being basically the entire game logic lol.### Continued development
Definitely wanna work on some more games to sharpen my javascript skills some more.
## Author
- Website - [Clonephaze](https://www.github.com/Clonephaze)
- Frontend Mentor - [@Clonephaze](https://www.frontendmentor.io/profile/Clonephaze)