-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Naik Mubashir <[email protected]>
- Loading branch information
1 parent
377761b
commit 89dc5f7
Showing
1 changed file
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |