Skip to content

michalvavra/wordle-cz-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wordle-cz-solver

Web-based solver for the Czech version of Wordle.cz. Helps you find possible words based on your guesses.

Wordle.cz Solver Screenshot

Features

  • Interactive Grid: Click letters to set colors based on Wordle.cz feedback
  • Smart Algorithm: Precise letter constraint handling with exact count enforcement
  • Czech Word Database: 2,863 words with diacritic normalization
  • Real-time Suggestions: Shows possible words as you add guesses
  • URL Sharing: Game state automatically saved in URL for easy sharing
  • Mobile-Friendly: Built with KelpUI for responsive design
  • No Build Tools: Pure HTML/CSS/JavaScript

Word Database

The Czech word list (words.txt) contains 2,863 five-letter words extracted from the allWords constant in Wordle.cz's JavaScript file. Words are stored concatenated without separators and normalized (diacritics removed) for consistent matching.

How to Use

  1. Open index.html in a web browser
  2. Enter a 5-letter word and click "Přidat slovo"
  3. Click letters to set colors:
    • Gray: Letter not in word
    • Orange: Letter in word, wrong position
    • Blue: Letter in correct position + appears elsewhere (minimum count)
    • Green: Letter in correct position + exact count (no more instances)
  4. View suggestions in "Možná slova" section

Development

Local Development

For development, serve the files using a local HTTP server (required for ES modules):

# Install serve globally
npm install -g serve

# Run development server
serve

# Open http://localhost:3000 in your browser

Alternatively, you can use any other static file server like Python's http.server or Live Server in VS Code.

Technologies

  • HTML5: Semantic markup with Web Components
  • CSS3: Modern styling with custom properties
  • JavaScript: ES6+ modules and features
  • KelpUI: Lightweight CSS framework

Algorithm

The solver uses a sophisticated constraint-checking algorithm that properly handles Wordle.cz's letter counting rules:

  • Green letters: Enforce exact count (if A is green, word has exactly that many A's)
  • Blue letters: Require minimum count (letter at position + appears elsewhere)
  • Mixed constraints: Green takes precedence over orange/blue for count enforcement
  • Czech normalization: Handles diacritics correctly (áa)

Testing

Run comprehensive test suites:

node tests/algorithm.test.js         # Core algorithm (19 tests)
node tests/wordle-scenarios.test.js  # Real-world scenarios (8 tests)
node tests/integration.test.js       # Integration tests

Deployment

For production deployment with nginx (e.g., using Coolify):

server {
    listen 80;
    root /usr/share/nginx/html;
    index index.html;

    # Security headers
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    # Block sensitive files with 302 redirect to index
    location ~* \.(md|png|jpg|jpeg|gif|json|lock|yml|yaml)$ {
        return 302 /;
    }

    # Everything else returns index.html
    location / {
        try_files $uri /index.html;
    }
}

This configuration:

  • Serves the SPA correctly (all routes → index.html)
  • Blocks sensitive files (README, screenshots, etc.) with redirect
  • Includes essential security headers

About

Solver for Wordle.cz that helps find possible words based on your guesses.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •