Skip to content

The Wordle repository is a simple implementation of the popular Wordle game. The game generates a random 5-letter word, and the player has 6 attempts to guess it, with feedback provided for each guess: green for correct letters, yellow for correct letters in the wrong position, and gray for incorrect letters.

License

Notifications You must be signed in to change notification settings

naikmubashir/Wordle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

This project is licensed under the MIT License.

About

The Wordle repository is a simple implementation of the popular Wordle game. The game generates a random 5-letter word, and the player has 6 attempts to guess it, with feedback provided for each guess: green for correct letters, yellow for correct letters in the wrong position, and gray for incorrect letters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published