Skip to content

Commit 7d5ad57

Browse files
authored
Merge pull request #26 from Mystify7777/wordle-game-gui
Added GUI based Wordle app in Python
2 parents 6bf7c93 + eec0519 commit 7d5ad57

File tree

8 files changed

+1038
-0
lines changed

8 files changed

+1038
-0
lines changed
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# 🤝 Contributing to Wordle GUI
2+
3+
Thank you for your interest in contributing to the Wordle GUI project! This document provides guidelines for contributing to this specific project.
4+
5+
## 📋 Project Overview
6+
7+
This is an **Advanced** level Python project that implements a fully-featured Wordle game with:
8+
9+
- Graphical user interface using Tkinter
10+
- Complete game logic with proper word evaluation
11+
- Statistics tracking with persistent storage
12+
- Modular code architecture
13+
- Comprehensive documentation and type hints
14+
15+
## 🎯 How to Contribute
16+
17+
### 🔰 For Beginners
18+
19+
- Improve documentation and comments
20+
- Add more words to the word list
21+
- Fix typos in README or code comments
22+
- Add simple features like keyboard shortcuts
23+
24+
### 🎯 For Intermediate Developers
25+
26+
- Enhance the GUI with better styling
27+
- Add sound effects or animations
28+
- Implement themes or color customization
29+
- Add input validation improvements
30+
- Create unit tests
31+
32+
### 🚀 For Advanced Developers
33+
34+
- Implement hard mode constraints
35+
- Add multiplayer functionality
36+
- Create word difficulty levels
37+
- Optimize performance
38+
- Add accessibility features
39+
- Implement custom word lists
40+
41+
## 🛠️ Development Setup
42+
43+
1. **Fork and Clone**:
44+
45+
```bash
46+
git clone https://github.com/mystify7777/Python-Basics-to-Advanced.git
47+
cd Python-Basics-to-Advanced/projects/advanced/Wordle_GUI
48+
```
49+
50+
2. **Test Current Implementation**:
51+
52+
```bash
53+
python test_game.py # Run basic tests
54+
python wordle.py # Test the main game
55+
```
56+
57+
3. **Development Requirements**:
58+
- Python 3.6+
59+
- Tkinter (usually included)
60+
- Type checking: `mypy` (optional)
61+
- Formatting: `black` (optional)
62+
63+
## 📝 Code Standards
64+
65+
### Code Style
66+
67+
- Follow **PEP 8** guidelines
68+
- Use **type hints** for all function parameters and returns
69+
- Add **comprehensive docstrings** for all classes and methods
70+
- Include **inline comments** for complex logic
71+
72+
### Example Code Structure
73+
74+
```python
75+
"""
76+
Title: Feature Description
77+
Author: Your Name
78+
Difficulty: Beginner/Intermediate/Advanced
79+
"""
80+
81+
def example_function(param: str, optional_param: int = 0) -> bool:
82+
"""
83+
Brief description of what the function does.
84+
85+
Args:
86+
param: Description of the parameter
87+
optional_param: Description with default value
88+
89+
Returns:
90+
Description of return value
91+
92+
Raises:
93+
ValueError: When input is invalid
94+
"""
95+
# Implementation with clear comments
96+
pass
97+
```
98+
99+
### File Organization
100+
101+
- `wordle.py`: All-in-one implementation
102+
- `wordle_logic.py`: Core game logic only
103+
- `wordle_gui.py`: GUI components only
104+
- `test_game.py`: Unit tests
105+
- `README.md`: Project documentation
106+
- `requirements.txt`: Dependencies
107+
108+
## 🧪 Testing Guidelines
109+
110+
### Before Submitting
111+
112+
- [ ] Run `python test_game.py` - all tests pass
113+
- [ ] Test both `wordle.py` and `wordle_gui.py`
114+
- [ ] Verify statistics save/load correctly
115+
- [ ] Check input validation works
116+
- [ ] Test win/loss conditions
117+
- [ ] Ensure code follows style guidelines
118+
119+
### Manual Testing Checklist
120+
121+
- [ ] Game starts without errors
122+
- [ ] Can enter 5-letter words
123+
- [ ] Invalid inputs show appropriate warnings
124+
- [ ] Color feedback works correctly (Green/Yellow/Gray)
125+
- [ ] Statistics update after games
126+
- [ ] Game ends properly on win/loss
127+
- [ ] Can play multiple rounds
128+
129+
## 🎨 Feature Ideas
130+
131+
### UI/UX Improvements
132+
133+
- Dark/light theme toggle
134+
- Custom color schemes
135+
- Better fonts and typography
136+
- Animations for tile reveals
137+
- Sound effects
138+
- Keyboard shortcuts
139+
140+
### Gameplay Features
141+
142+
- Hard mode implementation
143+
- Multiple difficulty levels
144+
- Custom word lists
145+
- Hint system
146+
- Timer mode
147+
- Daily challenges
148+
149+
### Technical Enhancements
150+
151+
- Better error handling
152+
- Performance optimization
153+
- Accessibility features
154+
- Internationalization
155+
- Database integration
156+
- Web version
157+
158+
## 🐛 Bug Reports
159+
160+
When reporting bugs, include:
161+
162+
- Python version
163+
- Operating system
164+
- Steps to reproduce
165+
- Expected vs actual behavior
166+
- Error messages (if any)
167+
- Screenshots (if relevant)
168+
169+
## 📚 Resources
170+
171+
- [Python PEP 8 Style Guide](https://pep8.org/)
172+
- [Tkinter Documentation](https://docs.python.org/3/library/tkinter.html)
173+
- [Type Hints Guide](https://docs.python.org/3/library/typing.html)
174+
- [Docstring Conventions](https://pep257.readthedocs.io/)
175+
176+
## 🏷️ Pull Request Process
177+
178+
1. **Create a descriptive branch name**: `feature/keyboard-shortcuts` or `fix/statistics-bug`
179+
2. **Write clear commit messages**: `Add: keyboard shortcut support` or `Fix: statistics not saving correctly`
180+
3. **Update documentation** if you add features
181+
4. **Add tests** for new functionality
182+
5. **Ensure all tests pass** before submitting
183+
184+
## 🎃 Hacktoberfest 2025
185+
186+
This project welcomes Hacktoberfest contributions! Valid contributions include:
187+
188+
- Bug fixes
189+
- Feature additions
190+
- Documentation improvements
191+
- Code quality enhancements
192+
- Test coverage improvements
193+
194+
---
195+
196+
**Happy Contributing! 🎯**
197+
198+
For questions, open an issue or start a discussion. We're here to help!
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# 🎮 Wordle GUI - Python Implementation
2+
3+
A fully-featured graphical Wordle game built with Python's Tkinter. Experience the popular word-guessing game with an intuitive interface, statistics tracking, and authentic gameplay mechanics.
4+
5+
## 📋 Table of Contents
6+
7+
- [Features](#-features)
8+
- [Prerequisites](#-prerequisites)
9+
- [Installation](#-installation)
10+
- [Usage](#-usage)
11+
- [Game Rules](#-game-rules)
12+
- [Project Structure](#-project-structure)
13+
- [Contributing](#-contributing)
14+
15+
## ✨ Features
16+
17+
### Core Gameplay
18+
19+
- **Classic Wordle Experience**: 6 attempts to guess a 5-letter word
20+
- **Visual Feedback**: Color-coded tiles (Green = correct, Yellow = wrong position, Gray = not in word)
21+
- **Interactive GUI**: Clean, modern interface built with Tkinter
22+
- **On-screen Keyboard**: Visual keyboard with color feedback
23+
- **Statistics Tracking**: Persistent game statistics (games played, win rate, streaks)
24+
25+
### Technical Features
26+
27+
- **Modular Design**: Separated game logic from GUI components
28+
- **Data Persistence**: JSON-based statistics storage
29+
- **Input Validation**: Robust word length and dictionary checking
30+
- **Cross-platform**: Works on Windows, macOS, and Linux
31+
32+
## 🔧 Prerequisites
33+
34+
- Python 3.6 or higher
35+
- Tkinter (included with most Python installations)
36+
37+
## 💻 Installation
38+
39+
1. **Clone the repository**:
40+
41+
```bash
42+
git clone https://github.com/username/Python-Basics-to-Advanced.git
43+
cd Python-Basics-to-Advanced/projects/advanced/Wordle_GUI
44+
```
45+
46+
2. **Verify Python installation**:
47+
48+
```bash
49+
python --version
50+
```
51+
52+
3. **Install dependencies** (if needed):
53+
54+
```bash
55+
pip install -r requirements.txt
56+
```
57+
58+
## 🚀 Usage
59+
60+
### Quick Start
61+
62+
```bash
63+
python wordle.py
64+
```
65+
66+
### Alternative (Modular Version)
67+
68+
```bash
69+
python wordle_gui.py
70+
```
71+
72+
### Game Instructions
73+
74+
1. Enter a 5-letter word in the text field
75+
2. Press Enter or click Submit
76+
3. Watch the tile colors for feedback:
77+
- 🟩 **Green**: Correct letter in correct position
78+
- 🟨 **Yellow**: Correct letter in wrong position
79+
-**Gray**: Letter not in the word
80+
4. Use the feedback to make your next guess
81+
5. Win by guessing the word in 6 attempts or fewer!
82+
83+
## 🎯 Game Rules
84+
85+
- **Word Length**: All guesses must be exactly 5 letters
86+
- **Attempts**: You have 6 chances to guess the correct word
87+
- **Valid Words**: Only words from the built-in dictionary are accepted
88+
- **Feedback System**:
89+
- Each letter is evaluated independently
90+
- If a word contains duplicate letters, feedback prioritizes exact matches first
91+
- **Win Condition**: Guess the exact word within 6 attempts
92+
- **Statistics**: Games played, wins, current streak, and best streak are tracked
93+
94+
## 📁 Project Structure
95+
96+
```bash
97+
Wordle_GUI/
98+
├── wordle.py # Main game file (all-in-one version)
99+
├── wordle_gui.py # GUI components (modular version)
100+
├── wordle_logic.py # Game logic (modular version)
101+
├── stats.json # Persistent statistics storage
102+
├── requirements.txt # Python dependencies
103+
└── README.md # Project documentation
104+
```
105+
106+
### File Descriptions
107+
108+
- **`wordle.py`**: Complete game implementation in a single file
109+
- **`wordle_gui.py`**: GUI interface and user interaction handling
110+
- **`wordle_logic.py`**: Core game mechanics and word evaluation
111+
- **`stats.json`**: JSON file storing player statistics
112+
- **`requirements.txt`**: List of required Python packages
113+
114+
## 🎮 Screenshots
115+
116+
When you run the game, you'll see:
117+
118+
- A 6x5 grid of letter tiles
119+
- An input field for typing guesses
120+
- An on-screen keyboard with color feedback
121+
- Win/loss message boxes with statistics
122+
123+
## 🛠️ Development
124+
125+
### Code Structure
126+
127+
```python
128+
"""
129+
Title: Wordle GUI Game
130+
Author: [Your Name]
131+
Difficulty: Advanced
132+
Description: A complete Wordle implementation with GUI interface
133+
"""
134+
```
135+
136+
### Key Components
137+
138+
- **WordleGame Class**: Handles game logic, word evaluation, and statistics
139+
- **WordleApp Class**: Manages GUI components and user interactions
140+
- **Color System**: Visual feedback using hex color codes
141+
- **Statistics System**: JSON-based persistent data storage
142+
143+
## 🧪 Testing
144+
145+
Run the game and test:
146+
147+
- Valid 5-letter word inputs
148+
- Invalid inputs (too short/long, not in dictionary)
149+
- Win conditions (correct guess)
150+
- Loss conditions (6 incorrect guesses)
151+
- Statistics persistence across games
152+
153+
## 🤝 Contributing
154+
155+
Contributions are welcome! Please read the [contributing guidelines](../../../CONTRIBUTING.md) before submitting pull requests.
156+
157+
### Ideas for Enhancement
158+
159+
- Expanded word dictionary
160+
- Difficulty levels
161+
- Hint system
162+
- Sound effects
163+
- Theme customization
164+
- Multiplayer mode
165+
166+
## 📝 License
167+
168+
This project is part of the Python-Basics-to-Advanced repository and follows the same license terms.
169+
170+
## 🎃 Hacktoberfest 2025
171+
172+
This project is participating in Hacktoberfest 2025! Feel free to contribute improvements, bug fixes, or new features.
173+
174+
---
175+
176+
**Happy Word Guessing! 🎯**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Wordle GUI - Python Requirements
2+
# This project uses built-in Python libraries
3+
4+
# Core GUI library (included with most Python installations)
5+
# tkinter>=8.6
6+
7+
# Note: tkinter is included with Python standard library
8+
# If tkinter is not available on your system, install it via:
9+
# - Windows: Usually included with Python
10+
# - macOS: Usually included with Python
11+
# - Linux (Ubuntu/Debian): sudo apt-get install python3-tk
12+
# - Linux (CentOS/RHEL): sudo yum install tkinter
13+
14+
# Development dependencies (optional)
15+
# black>=22.0.0 # Code formatting
16+
# flake8>=4.0.0 # Linting
17+
# mypy>=0.950 # Type checking
18+
19+
# No additional packages required for basic functionality

0 commit comments

Comments
 (0)