The same daily puzzle for everyone, from the date alone: how we build daily games, and what went wrong

Our site has six daily games where the puzzle changes every day and everyone playing that day gets the same one. Five are Japanese-only, like an emoji spot-the-difference and a color-matching game; the sixth is the Daily Challenge in Doodle Stack, our drawing-and-stacking game, which also has an English version. The Daily Challenge gives everyone the same drawing prompts in the same order that day.

This note explains, with real code, how we give everyone the same daily puzzle from the date alone, with no puzzle server: where "today" begins, keeping puzzles from repeating, sharing results without spoilers, and daily leaderboards. Recalculating things for this note also turned up mistakes, which are included. All code and numbers are as of October 23, 2026.

Our six daily games

Game What changes daily How it's chosen Where "today" starts
Guess the Price The item to price (1 of 48) Day number mod 48 Device date
Chameleon The color to match Computed from the day number Device date
AI or Human 5 of 40 questions Shuffle seeded by day number Device date
Emoji Cipher 5 of 20 questions, plus answer order Shuffle seeded by day number Device date
Daily Oddity 20 emoji tiles and 5 "oddities" PRNG seeded by day number Device date
Doodle Stack (Daily Challenge) The order of 42 drawing prompts Shuffle seeded by the date string Japanese version: Japan time. English: UTC

The first five were made in June–July 2026 and are once-a-day games. Doodle Stack's Daily Challenge was added on October 21; you can try it as many times as you like, and it has a daily leaderboard. Because they were made at different times, they draw the line for "today" differently, and that difference is one of the main points here.

The basic idea: don't hand out puzzles, have everyone do the same math

There are two ways to deliver a daily puzzle: a server picks today's puzzle and sends it out, or every browser runs the same calculation. All six of ours do the latter.

The puzzle list (items, haiku, emoji riddles, prompts) is in the page from the start. The date decides which entry to show, so on the same date every phone and computer gets the same puzzle. No server needed, and it starts instantly.

The weakness: anyone who reads the page's code can find today's answer. Fine for a game among friends; not for anything where the answer must really stay hidden, like prizes.

There are three steps.

Step 1: turn the date into a number

The first five games count days with June 1, 2026 as day 0.

// Find "today at 00:00" on the device clock, and count days since June 1, 2026
const EPOCH = new Date('2026-06-01T00:00:00');
function getDayNumber() {
  const now = new Date();
  const localMidnight = new Date(now.getFullYear(), now.getMonth(), now.getDate());
  const diffMs = localMidnight.getTime() - EPOCH.getTime();
  return Math.max(0, Math.floor(diffMs / (1000 * 60 * 60 * 24)));
}

On a device in Japan, October 23, 2026 is day 144. The "#144" shown in Daily Oddity and Emoji Cipher is this number. It's in the shared text too, so people can tell they solved the same puzzle.

Step 2: use the number as a seed

Math.random() differs per device and per load, so it won't do. Instead we use a PRNG that always produces the same sequence from the same seed, anywhere, anytime: a short function called mulberry32.

Step 3: shuffle and take from the front

Shuffle question indices with that PRNG (Fisher-Yates) and use the first five. AI or Human and Emoji Cipher work this way.

// A seeded PRNG: the same seed gives the same sequence on every device (mulberry32)
function mulberry32(seed) {
  let a = seed >>> 0;
  return function () {
    a = (a + 0x6d2b79f5) | 0;
    let t = Math.imul(a ^ (a >>> 15), 1 | a);
    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
  };
}
// Shuffle question indices with the day's PRNG (Fisher-Yates)
const rng = mulberry32(dayNumber + 1);
const indices = Array.from({ length: ITEMS.length }, (_, i) => i);
for (let i = indices.length - 1; i > 0; i--) {
  const j = Math.floor(rng() * (i + 1));
  [indices[i], indices[j]] = [indices[j], indices[i]];
}
// The first 5 are today's questions
const todays = indices.slice(0, 5).map((i) => ITEMS[i]);

Emoji Cipher is multiple choice, and in the data the correct answer is always listed first. Shown as is, the top choice would always be right, so the choices are shuffled too, with a separate seed per question: day number × 100 + the question's position that day (from 0) + 1.

Daily Oddity uses the PRNG directly instead of shuffling. Three seeds: one picks the top 20 emoji, one picks the 5 oddity positions, one swaps those 5 in the bottom grid for different emoji. The replacement is "the original emoji shifted by 1–14 places", so a swap can never land on the same emoji and erase the oddity.

Doodle Stack seeds from the date as a string

The Daily Challenge, built in October, does it a little differently. It doesn't count days; it uses the string "2026-10-23" directly.

// Japanese version: add 9 hours, then read it as UTC
// -> Japan's date regardless of the device's time zone setting. English version: plain UTC
const todayKey = (ms = Date.now()) =>
  new Date(ms + (CFG.board === 'en' ? 0 : 9 * 3600e3)).toISOString().slice(0, 10);
todayKey(); // -> '2026-10-23'

That string is hashed into a number, which seeds the prompt shuffle.

function dailySeq(key) {          // key is a string like '2026-10-23'
  // turn the string into one number (FNV-1a hash)
  let h = 2166136261;
  for (const ch of key) h = Math.imul(h ^ ch.charCodeAt(0), 16777619);
  const rnd = mulberry32(h >>> 0);  // (the real code inlines the same math)
  // shuffle all 42 prompts: 20 easy + 22 normal
  const seq = ODAI_SETS.easy.concat(ODAI_SETS.normal).map((e) => e[0]);
  for (let i = seq.length - 1; i > 0; i--) {
    const j = Math.floor(rnd() * (i + 1));
    [seq[i], seq[j]] = [seq[j], seq[i]];
  }
  return seq;
}
// each new piece takes the next prompt in this order
odai = daily.seq[count % daily.seq.length];

The first six prompts for three days (Japanese version):

Date First six prompts
Oct 21, 2026 TV → heart → sushi → snowman → bread → cat
Oct 22, 2026 mandarin orange → tofu → snowman → train → shoe → pillow
Oct 23, 2026 dog → elephant → mandarin orange → car → cat → train

Doodle Stack has 62 prompts: 20 easy, 22 normal, 20 hard. The Daily Challenge uses only the 42 easy and normal ones. All 42 are shuffled at the start of the day, so within one game no prompt repeats until you've stacked 42. The "different prompt" button from normal mode is hidden here, so everyone stacks in the same order.

One reason for using the string: the next question, when "today" begins, had to differ between the Japanese and English versions.

When does "today" begin?

The date boundary is the hardest part of a daily game. If people disagree on where today starts, "everyone gets the same puzzle" falls apart.

The first five: the device's date

The June–July games use the device clock and time zone to find midnight. In Japan the puzzle changes at midnight Japan time, which is fine for players in Japan.

Players elsewhere get a new puzzle at their own midnight, so at the same moment, someone in Japan and someone abroad can be on different days. And in places with daylight saving time, some days are 23 or 25 hours long, so "divide the millisecond difference by 24 hours and round down" can be off by a day depending on place and season. Neither happens if everyone plays in Japan.

Doodle Stack: it has a leaderboard, so it matches the server

The Daily Challenge has a daily leaderboard, so the game's idea of today must match the leaderboard server's. Hence todayKey above, "add 9 hours and read as a UTC date", with the same function on the server (Cloudflare Pages Functions). Whatever the device's time zone, the Japanese version switches at midnight Japan time.

The English version switches at midnight UTC and has its own leaderboard. The same game has two "todays", 9 hours apart.

The server caches each top-of-board table for 20 seconds. The cache name includes the date, so a new day automatically gets a new table and yesterday's never lingers.

Device clocks can be wrong

Both approaches trust the device clock for what time it is now, and device clocks can be wrong.

That actually happened in another game. In Squad Island, where friends share one island, two devices whose dates were more than 30 days apart kept rewriting the island's date twice a second, each "correcting" the other. Actions could be lost and the write limit got close, so on October 22 we capped the day-change write at twice per island per day. A test confirms it went from 16 writes in 8 seconds to 0.

In Doodle Stack, the device clock picks the prompt order, but the server's clock decides which day a record belongs to. A wrong device clock can't put a record on the wrong day. The catch: a game that crosses midnight keeps the previous day's prompts but posts to the new day's board. That only affects a few minutes around midnight.

Avoiding repeats, and where it didn't work

For daily players, "same puzzle as yesterday" is the biggest letdown. The six games handle it differently:

We counted the overlap for those two using the game's own math, over the 144 day-to-next-day pairs from June 1 to October 23, 2026:

Game Pool Days sharing 1+ question with the day before Average shared questions
Emoji Cipher 5 of 20 116 of 144 1.34
AI or Human 5 of 40 82 of 144 0.75

Emoji Cipher mixed in yesterday's questions on roughly 4 days out of 5. With a small pool, shuffle everything once and step through it 5 a day, like Guess the Price, instead of picking randomly each day. We didn't think that far when we built them; that's on us.

Mistake: Chameleon's red barely changed

Recalculating for this note turned up something else. Chameleon makes "today's color" from red, green and blue values (0–255 each), and you match it with sliders. Red was computed like this:

// Chameleon's "today's color" (the red part)
function lcg(seed) {
  return ((seed * 1664525 + 1013904223) >>> 0) / 0xFFFFFFFF;
}
const r = Math.round(lcg(dayNumber + 1) * 255);

That's one step of a linear congruential generator, an old way to make random numbers. It looks random, but each +1 to the seed always adds the same amount (about 0.0004). It's just a linear function. Times 255, that's about 0.1 per day.

Computed out, red was 60 on June 1 and 75 on October 23: between 60 and 75 the whole time since launch. It won't pass 128 until April 12, 2028. So bright reds, pinks, oranges and yellows, colors with high red, have never appeared. Green only rises 5–6 a day. Only blue changed a lot from day to day.

Every day looked like a different color, so playing never revealed it. As of October 23, 2026 it isn't fixed. A fix would run the seed through a PRNG like mulberry32, where a seed change of 1 changes the output a lot.

The lesson: even if a calculation looks random, line up several days of output and see how it moves when the seed goes up by 1. A few days side by side made the stuck red obvious.

Sharing results without spoilers

Half the fun of a daily game is comparing results with friends, without showing the answer to people who haven't played yet. So every game turns the result into emoji squares and leaves the answer out.

Game What's shared What's left out
Daily Oddity The 5 oddities in order: 🟩 found, ⬛ missed Where they were
AI or Human 🟩 right, 🟥 wrong for 5 questions The texts, and which was AI
Emoji Cipher 🟩🟥 plus the emoji puzzles themselves The answer words
Chameleon For each of red, green, blue: 🟩 within 15, 🟨 within 45, 🟥 beyond Today's color values

A Daily Oddity share looks like this (translated; numbers are an example):

🔎 Daily Oddity #144
4/5 found ⏱ 38s
🟩🟩⬛🟩🟩
🔥 3-day streak

"#144" is the day number from earlier. The streak line appears only after two or more days in a row. Putting the streak in the share text started on June 29 with Guess the Price and Chameleon, and the three games built after that had it from the start. The idea is to turn a private record into one you want to show.

Only Emoji Cipher shares the puzzle itself (minus the answer), so whoever receives it can try the same riddle.

What the share button does

The first five games share one component:

Doodle Stack shares an image of your tower plus the prompts you stacked (up to six, like "cat → dog → ..."). The image is made as soon as the result appears. If you start making it after the share tap, Safari no longer treats it as a response to the tap and won't open the share sheet.

We don't count share-button presses; the component doesn't send anything to a server. We only know about shares we happen to see on X and elsewhere.

Doodle Stack's daily leaderboard

A public leaderboard needs protection from abuse and floods. What we actually added is in a separate note.

Why not once a day?

The first five are once-a-day, like Wordle. When you finish, the result is saved, and opening it again that day shows your result instead of the puzzle.

Doodle Stack's Daily Challenge is deliberately unlimited. CrazyGames, where we'd published the English version, judged games on average playtime per session, the share of players returning the next day, and the share who played over a minute. A once-a-day, few-minutes game gives a reason to return but shortens each session. So the Daily Challenge is the reason to come back tomorrow, while within the day you can play as much as you like and only your best goes on the board.

The Daily Challenge went into the CrazyGames version on October 21 too. But other improvements shipped the same day, and next-day numbers arrive a day late, so as of October 23, 2026 we can't separate the Daily Challenge's own effect. How the CrazyGames launch went is in our submission note.

A real bug: the Daily Challenge label vanished in dark mode

Right after release, we noticed that in dark mode (a blackboard look in Doodle Stack) the Daily Challenge button's label on the title screen was invisible.

The cause was the color setup. In dark mode, "text color" and "paper color" were the same (#f1eee4), so paper-colored text and dotted lines were drawn on a paper-colored button. We changed them to a dark color that reads on the button.

Browsers hold on to CSS and JavaScript they loaded before, so a fixed file on the server may not reach players right away. We add a dated marker like "?v=20261023a" to the file URLs so they're fetched fresh.

If you're making a daily game

  1. Decide up front where "today" begins. Device date, or fixed to a time zone like Japan time or UTC? If a server is involved, as with a leaderboard, use the same function in the game and on the server.
  2. Use a seeded PRNG, and look at several days of output. Some calculations look random but move by a fixed step per seed (Chameleon's mistake).
  3. With a small pool, cycle through it instead of picking randomly each day. Picking 5 of 20 at random daily mixed in yesterday's questions on 4 days out of 5.
  4. Share the day number, never the answer. The number lets people who solved the same puzzle compare.
  5. Don't fully trust the device clock. Let the server's clock decide dates that matter, like leaderboard days.
  6. Once a day or unlimited depends on which number you want to grow.

When we fix Chameleon's color and the Emoji Cipher / AI or Human overlap, we'll add it here.

Update (November 6, 2026)

The CrazyGames Basic Launch ended on October 28 without passing, and on October 29 we decided not to submit there again. So the Daily Challenge's own effect was never separated from the other changes, and we won't be adding CrazyGames numbers for it here. The English version now runs on our own site, since November 4. It still switches at midnight UTC and still has its own leaderboard.

As of November 6, Chameleon's color and the Emoji Cipher / AI or Human overlap are not fixed yet.

Nandemo Factory is a one-person studio in Japan that makes small browser games, with AI doing most of the work. We only write about things we built and checked ourselves, with the numbers we actually saw. Play the games in English.

Related notes