Skip to content
/ Wordle- Public

This is a Python Shell implementation of the popular online game "Wordle" where a player has 6 chances to guess a mystery 5 letter word.

Notifications You must be signed in to change notification settings

Sauceg/Wordle-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. **File Handling and Dictionary Creation:**
   - The code opens a file named 'word5Dict.txt', reads its content, and separates words by '#'.
   - It defines a function `check_edgeCases(infile)` to check edge cases of words in the file and returns a list of words.
   - The function writes the filtered words into a new file named 'scrabble5txt'.

2. **ScrabbleDict Class:**
   - This class represents a dictionary of words, initialized with a specific size and a filename.
   - It loads words from the provided file based on the given size and creates a dictionary.
   - It provides methods to check if a word exists in the dictionary, get the size of the dictionary, get words starting with a given letter, and more.
   - The `dictionary_analysis()` method analyzes the dictionary, counts occurrences of each letter, and prints the analysis.

3. **Wordle-like Game:**
   - The game randomly selects a word of the day from the loaded dictionary.
   - It allows the player a limited number of attempts to guess the word of the day.
   - The player's attempts are checked against the word of the day, and feedback is provided based on correct letters and positions.
   - The game ends if the player correctly guesses the word or exceeds the allowed number of attempts.

4. **Main Function:**
   - The `main()` function tests the ScrabbleDict class and runs the Wordle-like game.

5. **Test and Execution:**
   - The script executes dictionary analysis, checks word existence, gets word size, retrieves words starting with a specific letter, and runs the Wordle-like game.

Overall, your code combines file handling, object-oriented programming, and game logic effectively. However, it's advisable to ensure proper error handling, comments, and clear separation of concerns for better readability and maintainability. Additionally, consider organizing your code into separate modules or functions for better modularity and reusability.

About

This is a Python Shell implementation of the popular online game "Wordle" where a player has 6 chances to guess a mystery 5 letter word.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages