Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregolive/janken
Learn how to play rock paper scissors in Japanese with this game of Janken (じゃんけん).
https://github.com/gregolive/janken
Last synced: 18 days ago
JSON representation
Learn how to play rock paper scissors in Japanese with this game of Janken (じゃんけん).
- Host: GitHub
- URL: https://github.com/gregolive/janken
- Owner: gregolive
- Created: 2021-09-12T13:52:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T14:08:56.000Z (about 3 years ago)
- Last Synced: 2023-07-25T07:27:39.121Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://gregolive.github.io/janken/
- Size: 250 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Janken
Learn how to play rock paper scissors in Japanese with this game of Janken (じゃんけん).
[Live demo](https://gregolive.github.io/janken/) 👈
## Functionality
- Play against the computer player by clicking on the rock, paper, or scissors buttons. The computer's move is highlighted by a red border and the player's by a blue border.
- Score is displayed below alongside a reset button that resets the scores.
- Above the buttons Japanese text is displayed to teach how Janken is started in the native language (alongside romanized prononcation).
- On a tie, the border of the selected move is split between the player's blue and the computer's red. The text above also changed to what is said in Japanese when a tie occurs.
- [Button illustrations](https://www.irasutoya.com/2013/07/blog-post_5608.html) by illustrator Takashi Mifune.## Reflection
I struggled at first with wrapping my head around event listeners in Javascript, especially when adding the same event listener to a group of buttons. Adding Array.from and utlizing the e arrow function was the eventual solution following some serious reading about event listeners and query selectors. This process really helped me undestand these concepts and the time spent now will be worth it later on.
The first iteration of this project included more explanation of the importance of Janken in Japan, however this cluttered the page and negativlty impacted useability. There are definitely more optimizations to be made on the JS and HTML, especially when it comes to the romainzed pronunciations and Japanese text. In order to center the pronunciations over the accompanying word I made individual object for each, but when it came time to change the text during a tie, the number of objects changed. I look forward to learning a better way to handle this in the future, as for now I brute forced it by setting the leftover HTML tags to an empty string.
-Greg Olive