Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Built a Turkish Wordle for Football Fans: The Deterministic Puzzle Algorithm

说明与用途

为土耳其足球迷打造的无状态 Wordle 风格每日谜题,日常玩家仅由日期确定,无需数据库。

问题

Daily puzzle games usually rely on a database to store the daily answer, creating stateful logic and potential sync issues during redeploys.

结果

The game runs statelessly, always delivering the same daily puzzle to all users without database writes, and includes a practice mode for unlimited play.

工作流

  • 1. Construct a seed from the current date (year, month, day).
  • 2. Pass the seed through a small deterministic hash function.
  • 3. Take the hash modulo 198 to get a player index.
  • 4. Retrieve the player from a static dataset of 198 players across 19 clubs.
  • 5. Normalize all player names and guesses (case folding, diacritic stripping).
  • 6. Compare guesses to the target using the normalized strings.
  • 7. Provide feedback on correct letters, correct club, or miss.
  • 8. Offer a practice mode that selects a random player index on each visit.

证据

Picking "today's player" never touches a database: the puzzle is generated deterministically from the date itself, so the core game logic stays completely stateless.

来源

Santra's guess-comparison logic is covered by Vitest unit tests that pin down exact matches, partial matches (right club, wrong player, for example), and misses.

来源

  • 记录日期: 2026-09-07T05:25:34.881Z