{
  "id": 9819643,
  "title": "A \"Daily Challenge\" That Resets at Midnight: Deterministic Picks Without a Backend",
  "url": "https://urgent.news/2026/09/25/a-daily-challenge-that-resets-at-midnight-deterministic-picks-without",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-25T19:24:45.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/akbo_ichou_c41c249cc2783d/a-daily-challenge-that-resets-at-midnight-deterministic-picks-without-a-backend-59ih"
  },
  "original_language": "en",
  "account": "Daily challenges, featured prominently on platforms like Classroom Games, are simple yet effective engagement tools. These challenges, such as Wordle's popular \"Today's Pick,\" grant users a single point opportunity each day. The unique aspect of this feature is its ability to function independently, without requiring a backend server.\n\nThe key to making this happen lies in utilizing the local date, derived from the player's device, rather than a global timestamp. This ensures that users in different time zones, like a classroom in California or one in Paris, receive a fresh challenge when their individual day begins. The function localDateKey calculates this local date key using the getFullYear, getMonth, and getDate methods from the Date object, ensuring the date format remains consistent regardless of time zone.\n\nOnce the local date key is established, the next step is to pick a challenge deterministically from that date. To do this, the date string is hashed using the FNV-1a algorithm, a tiny and fast hashing function suitable for selecting an item from a list. The resulting hash is then used to index into an array of predefined categories (math, typing, reading, etc.) to determine the day's challenge.\n\nTo prevent users from receiving the same challenge back-to-back, the algorithm includes a secondary check against the previous day's challenge. If a collision occurs, the algorithm steps forward to the next category, ensuring variety and user satisfaction. This method maintains the randomness of the selection while preventing redundant challenges.\n\nFinally, to track user progress, the status of the challenge (Not started, in progress, or goal reached) is stored locally in the browser's localStorage, using the local date key as the identifier. This approach allows for seamless tracking without the need for a server, making the feature accessible and easy to implement on any games site.",
  "summary": "Daily challenges are one of the simplest engagement features you can add to a games site — Wordle made the pattern famous. On Classroom Games , a collection of free learning games for teachers (math, typing, spelling, reading comprehension, geography, fractions, multiplication, sight words, brain breaks and more), the homepage shows one \"Today's Pick\" with a points goal. It resets at midnight,…",
  "key_points": [
    "Daily challenges function independently without backend server",
    "Local date key ensures unique challenges per time zone",
    "FNV-1a hashing prevents repeated challenges"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}