Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Co-Authored-By: Naik Mubashir <[email protected]>
  • Loading branch information
aqib-m31 and naikmubashir committed Nov 10, 2023
1 parent 377761b commit 89dc5f7
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# World
# Wordle Game

This is a simple implementation of the popular Wordle game in JavaScript.

## How to Play

The game generates a random 5-letter word. The player's goal is to guess this word. After each guess, the game provides feedback:

- If a letter is correct and in the right position, its box turns green.
- If a letter is correct but in the wrong position, its box turns yellow.
- If a letter is incorrect, its box turns gray.

The player has 6 attempts to guess the word. If the player guesses the word within these attempts, they win. Otherwise, they lose.

## Implementation

The game is implemented in pure JavaScript, with no external libraries. It uses the Fetch API to get random words from an API.

The game logic is handled by several functions:

- `drawGrid()`: Draws the game grid.
- `getRandomWord()`: Fetches a random word from an API.
- `handleGame()`: Handles the game logic.
- `attachListener()`: Attaches a keypress event listener to the input boxes.
- `getWord()`: Gets the word from the current row.
- `checkWord()`: Checks the player's word against the actual word.
- `startGame()`: Starts the game.

## Running the Game

[GitHub Pages Deployment](https://naikmubashir.github.io/Wordle/)


## License

This project is licensed under the MIT License.

0 comments on commit 89dc5f7

Please sign in to comment.