An intelligent AI bot built with Flutter that automatically solves Wordle-like puzzles by connecting to the Wordle API. This project demonstrates advanced problem-solving approaches, clean code architecture, and seamless external service integration.
The Wordle AI Bot showcases how to build a sophisticated puzzle-solving application using Flutter. It demonstrates:
- API Integration: Seamless communication with external REST APIs
- AI Algorithms: Intelligent word selection and pattern analysis
- Clean Architecture: Well-structured, maintainable code
- Modern UI: Beautiful Material Design 3 interface
- State Management: Efficient Flutter state handling
- Error Handling: Robust error handling and user feedback
- Automatic Puzzle Solving: AI-driven word selection algorithms
- Multiple Game Modes: Daily puzzles, random words, and custom challenges
- Real-time API Communication: Live interaction with the Wordle API
- Performance Tracking: Comprehensive statistics and analytics
- Responsive Design: Works on all Android device sizes
- Frequency Analysis: Letter frequency-based word scoring
- Pattern Recognition: Intelligent elimination of impossible words
- Information Maximization: Words chosen to provide maximum information gain
- Adaptive Strategy: Adjusts approach based on previous results
- Beautiful Interface: Modern Material Design 3 aesthetics
- Real-time Feedback: Live updates during solving process
- Game History: Track performance across multiple sessions
- Customizable Options: Adjust seeds and game modes (5-letter words only)
lib/
โโโ main.dart # Main application entry point
โโโ models/ # Data models and enums
โ โโโ wordle_models.dart # Core data structures
โโโ services/ # Business logic and API communication
โ โโโ wordle_api_service.dart # API client and HTTP handling
โ โโโ word_analyzer_service.dart # Word analysis and scoring
โ โโโ wordle_solver_service.dart # Core AI solving logic
โโโ (UI components) # Flutter widgets and screens
- Handles all HTTP communication with the Wordle API
- Implements proper error handling and timeout management
- Supports all API endpoints (daily, random, custom)
- Analyzes word frequency and letter patterns
- Provides intelligent word scoring algorithms
- Filters words based on game feedback
- Orchestrates the solving process
- Implements the core AI logic
- Manages game sessions and state
GuessResult: Individual letter feedbackGameSession: Complete game stateGameStats: Performance metricsApiResponse: Generic API response wrapper
- Flutter SDK (3.4.0 or higher)
- Android Studio or VS Code
- Android device or emulator
- Internet connection for API access
-
Clone or navigate to the project:
cd wordle_ai_bot -
Install dependencies:
flutter pub get
-
Run the app:
flutter run
# Ensure you have an Android device connected or emulator running
flutter devices
# Run the app
flutter run
# Or run specifically on Android
flutter run -d android- Daily: Solve the daily puzzle
- Random: Solve a random word (with optional seed)
- Custom: Solve a specific word of your choice
- Set random seed for reproducible puzzles (Random mode)
- Enter custom target word (Custom mode)
- Note: All puzzles use 5-letter words (API limitation)
- Tap "START SOLVING"
- Watch the AI work in real-time
- View results and statistics
- Real-time solving progress
- Color-coded feedback for each guess
- Performance statistics and history
- Uses high-frequency letters (E, A, R, T, O, I, N, S)
- Prioritizes words with common letter patterns
- Examples: "raise", "slate", "crane"
- Analyzes feedback to eliminate impossible words
- Scores remaining words by information gain
- Considers letter frequency and pattern matching
- Correct (Green): Letter in right position
- Present (Yellow): Letter in word, wrong position
- Absent (Grey): Letter not in word
Word Score = Letter Frequency + Pattern Bonus + Information Gain
- Letter Frequency: Based on English language statistics
- Pattern Bonus: Bonus for common letter combinations
- Information Gain: Potential to eliminate word candidates
GET /daily- Daily puzzle with guess parameterGET /random- Random word puzzle with optional seedGET /word/{word}- Custom word puzzle
[
{
"slot": 0,
"guess": "a",
"result": "absent"
},
{
"slot": 1,
"guess": "b",
"result": "present"
}
]- Network timeout management
- API error responses
- Graceful degradation
- User-friendly error messages
The bot tracks comprehensive statistics:
- Success Rate: Percentage of puzzles solved
- Average Guesses: Mean guesses per puzzle
- Solving Time: Time taken per puzzle
- Win Streaks: Current and best streaks
- Guess Distribution: Breakdown by number of guesses
- Modern color scheme and typography
- Responsive layout for all screen sizes
- Smooth animations and transitions
- Intuitive navigation and controls
- Color-coded guess results
- Progress indicators during solving
- Status messages and notifications
- Interactive game mode selection
- Clear visual hierarchy
- Readable typography
- Touch-friendly controls
- Screen reader support
Edit word_analyzer_service.dart to:
- Change letter frequency weights
- Add new scoring algorithms
- Modify word selection strategies
- Extend the word list in
wordle_solver_service.dart - Implement word list loading from files
- Add support for different languages
- Modify color schemes in
main.dart - Add new game modes and options
- Customize statistics display
- Automatic retry with exponential backoff
- Graceful timeout handling
- Offline mode detection
- HTTP status code handling
- Rate limiting respect
- User-friendly error messages
- Word length validation
- Character set restrictions
- Game mode validation
- Machine Learning: Train models on historical data
- Multi-language Support: Solve puzzles in different languages
- Advanced Analytics: Detailed performance insights
- Social Features: Share results and compete with friends
- Caching: Local storage for offline play
- Background Processing: Solve puzzles in background
- Push Notifications: Daily puzzle reminders
- Cloud Sync: Cross-device progress synchronization
We welcome contributions! Areas for improvement:
- Algorithm Optimization: Better word selection strategies
- Performance: Faster solving algorithms
- UI/UX: Enhanced user experience
- Testing: Comprehensive test coverage
- Documentation: Improved code documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is open source and available under the MIT License.
- Wordle API: Provided by wordle.votee.dev
- Flutter Team: Amazing cross-platform framework
- Material Design: Beautiful design system
- Open Source Community: Inspiration and support
If you encounter issues or have questions:
- Check the API status at wordle.votee.dev:8000
- Review the error messages in the app
- Check your internet connection
- Ensure Flutter is properly configured
Happy Wordle Solving! ๐ฏโจ