Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 13 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
# Create a game

## Overview
Create a hangman game! <br>
Example of what we want to accomplish
![Example of hangman game](images/example.jpg)
### Requirements

1. HTML:
1. Add buttons that correspond to each letter from a to z.
2. Add a section that will hold the blanks that are going to be equal to the number of characters for the current word.
3. Add a div to show the man who's going to be hanged if you lose.
4. Add a counter from 10 that will decrease by 1 with every wrong guess.
4. Add a button to play again.

2. JS:
1. At the beginning use fetch API to retrieve a random word from this api https://random-word-api.herokuapp.com/word?number=1. Make the blanks equal the number of letters in the random word.
2. Everytime the user clicks on one of the letters the following should happen:
1. The random word is search through to find if it contains the clicked letter, if the clicked letter is part of the random word's letters then it gets shown up instead of the space, if not, then the lives counter is decreased by one. In some rare cases a clicked letter corresponds to two letters in the generated word, if that happens then show both words.
2. The button becomes disabled and should only work once.
3. If the lives counter reaches 0 then the game is over and the hangman should be HANGED! 👨‍🦱🔪
4. Clicking on the play again button should do the whole process again.


NOTE: Be creative with the game's mechanics and design!!!
Have fun, and Good luck :D
Recoures
1-https://www.npmjs.com/package/typewriter-effect
typewriter effect to retypteing a text
2-https://www.npmjs.com/package/react-loader-spinner
loader when loading the API
3-https://reactjs.org/docs/faq-ajax.html
callinging API
4-https://ozmoroz.com/2018/07/pass-value-to-onclick-react/
How to pass a value to onClick event handler in React.js
5-https://www.pluralsight.com/guides/how-to-pass-data-between-react-components How to Pass Data between React Components
6-https://medium.com/@tundeszirak/hangman-game-with-reactjs-32b6587c5d66 Hangman with resocures in meduim
https://stackoverflow.com/questions/54268975/hot-to-get-value-of-button-in-react
dealign with the value of buttons in reacts and passig it between componenets
75 changes: 7 additions & 68 deletions hangman/README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,7 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `yarn build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Recoures
1-https://www.npmjs.com/package/typewriter-effect typewriter effect to retypteing a text
2-https://www.npmjs.com/package/react-loader-spinner loader when loading the API
3-https://reactjs.org/docs/faq-ajax.html callinging API
4-https://ozmoroz.com/2018/07/pass-value-to-onclick-react/ How to pass a value to onClick event handler in React.js
5-https://www.pluralsight.com/guides/how-to-pass-data-between-react-components How to Pass Data between React Components
6-https://medium.com/@tundeszirak/hangman-game-with-reactjs-32b6587c5d66 Hangman with resocures in meduim
Loading