Home › JWorld Blog

How Block Daily deals its blocks: 15 drawings, one seed, and a save that replays the dice

JWorld team ·

A look inside the 8×8 puzzle's core logic: how 37 blocks come from 15 text drawings, how weights stay fair, when a deal is redone, and how saves resume with the same upcoming blocks.

Block Daily is a small puzzle. The board is 8×8, you get three blocks at a time, and a full row or column clears. The code behind the dealing is small too: the whole core logic folder is under 700 lines. Still, a few choices in it decide whether the game feels fair, and whether the Daily Challenge really gives everyone the same blocks.

The JWorld team wrote this article from that code. If you want the player's view (scoring, combos, themes), our earlier tips guide covers it. Here we look at the machinery: where the blocks come from, how they are picked, what happens when a deal would be unplayable, and how a saved game picks up exactly where it stopped. You can play it in your browser.

The home screen: the Daily Challenge card with a 6-day streak, and the Classic card with New game and Continue buttons
The home screen: the Daily Challenge card with a 6-day streak, and the Classic card with New game and Continue buttons

37 blocks from 15 drawings

Blocks never rotate in play. That means a vertical 3-bar and a horizontal 3-bar are different pieces as far as the game is concerned. Typing out all 37 of them by hand would invite mistakes, so the code does not.

Each base shape is a tiny text drawing, with # for a filled cell and / between rows. The L piece is #./#./##. A small function reads the drawing into a list of [row, column] cells, then shifts the cells so the top-left corner is at 0,0. A second function rotates the cells by 90 degrees. The builder rotates each shape up to four times and keeps a rotation only if its cell list is new.

That duplicate check matters. The 2×2 square looks the same after every turn, so it yields one block. A bar looks the same after two turns, so it yields two. An L has four distinct orientations.

Base shapeCellsDistinct blocks
Dot11
2×2 square, 3×3 square4 / 91 each
2-, 3-, 4-, 5-cell bars2 to 52 each
2×3 rectangle, S, Z6 / 4 / 42 each
Small corner (3 cells)34
L, J, T (4 cells) and big corner (5 cells)4 / 4 / 4 / 54 each

The total is 1 + 1 + 1 + 8 + 6 + 4 + 16 = 37 blocks. The J is the mirror image of the L, but the game lists it as its own base shape, which is why both appear. Adding a new block is one line of ASCII art plus a weight.

Weights are split per orientation

Every base shape has a weight that says how often it should be dealt. The weights add up to 12.7, so a shape's share of all deals is its weight divided by 12.7.

ShapeWeightShare of deals (about)
2×2 square1.310.2%
2-bar, 3-bar1.2 each9.4% each
Dot, 4-bar, small corner1.0 each7.9% each
L, J, T0.8 each6.3% each
5-bar0.75.5%
3×3 square, S, Z, 2×30.6 each4.7% each
Big corner0.53.9%

There is a trap here. If every rotated block carried the full weight of its base shape, an L with four orientations would be dealt four times as often as the 2×2 square with one. So the builder divides the base weight by the number of distinct orientations. A 3-bar has weight 1.2 and two orientations, so each one weighs 0.6. A small corner has weight 1.0 and four orientations, so each weighs 0.25.

The code comment says it directly: spread the base weight over the orientations, so a shape with four of them is not dealt four times as often.

Picking a block is a weighted roll. The game draws one random number, multiplies it by the total weight, then walks the list subtracting each weight until the number goes below zero. The block where that happens is dealt. Each block in the tray also gets a color: one of seven, from a second random number. So one fresh tray of three blocks uses six random numbers.

Fixing impossible deals, but only in Classic

If you have only a few empty cells left, a random 5-bar could show up and fit nowhere. Losing to that would feel like bad luck, not bad play.

In Classic mode, after the game deals three blocks, it checks whether at least one of them fits somewhere on the board. The check is simple: for each block, try every possible top-left position (a dot has 64 positions, a 5-bar has 32) and stop at the first one that works. If none of the three fits, the tray is thrown away and dealt again, up to 30 times.

Two details are worth noticing:

  • The test is "at least one piece fits", not "all three fit". The game does not promise a comfortable tray, only that you are not dead on arrival.
  • After 30 failed tries the last tray is kept. On a board that is truly full, the game can still end. That is the correct outcome.

The Daily Challenge turns this protection off. The reason is the number of random calls. A redeal consumes extra random numbers, and how many depends on the board, so two players with different boards would drift onto different sequences after the first redeal. Without redeals, every deal uses exactly six calls, and the n-th tray is the same for everybody, whatever they did on the board. That is the price of a fair shared puzzle: you sometimes get a harsh tray, and so does everyone else.

Dragging a block on a nearly full board: the bottom two rows are highlighted as they would clear, and one tray slot is already empty
Dragging a block on a nearly full board: the bottom two rows are highlighted as they would clear, and one tray slot is already empty

From a date to a seed

The Daily Challenge needs no server. The date string, such as 2026-10-03, goes through a small hash (FNV-1a, a few lines long) that turns text into one 32-bit number. That number seeds a generator called mulberry32, which produces the stream of random numbers. Same date, same seed, same stream, on every phone and browser.

Two consequences follow from the design:

  1. The day is your local calendar day. The key is built from the year, month and day on your own device, so the daily puzzle turns over at your local midnight. Someone in another time zone can be on a different day's puzzle at the same moment.
  2. The streak survives until a whole day is missed. The previous day is worked out with ordinary calendar arithmetic, so it behaves across month and year boundaries. If your last finished day was yesterday or today, the streak shows. Otherwise it reads zero, and the next finished challenge starts again at 1.

Only one attempt per day is stored. Finishing a second time on the same date changes nothing, so the saved score is the first one.

A save that replays the dice

Close the app in the middle of a Classic game and the home screen offers Continue next to New game. The save has to bring back more than the board.

What is stored: the 64 cells of the grid, the ids of the blocks in the tray (empty slots stay empty), the score, the combo, how many placements have passed without a clear, and one more number: how many random numbers have been drawn so far.

On restore, the game builds a new generator from the same seed and draws and discards that many numbers. The generator is now exactly where it was when you quit, so the next tray is the same one you would have got without closing the app. You cannot reroll your future by quitting.

The restore also guards against bad data. It gives up, and the app starts clean, if the save version is unknown, if the grid is not 64 cells, or if a block id no longer exists. After loading, it re-checks whether any move is left, so an old save cannot leave you on a dead board.

The Continue button picks the fullest 3×3

When a Classic game ends, you can use Continue once. The game looks at every 3×3 window on the board. There are 6 positions across and 6 down, so 36 windows. It counts the filled cells in each, picks the highest count, clears that window and deals a new tray. Ties go to the first window found, scanning from the top-left row by row.

Knowing this lets you plan a little: if the board is nearly dead, the cleanup will hit the densest square, so the stack you built in one corner is what disappears.

Summary

  • 37 blocks come from 15 text drawings, rotated in code, with duplicate rotations removed.
  • A base weight is split across its orientations, so shapes with more orientations are not dealt more often. The total weight is 12.7.
  • Classic redeals up to 30 times when no block fits. The Daily Challenge never redeals, so every player gets the same trays.
  • The date is hashed into a seed, using your local calendar day. No server is involved.
  • A save stores the board, the tray and the count of random numbers used, and restores by replaying that many draws.
  • Continue clears the 3×3 window with the most filled cells out of 36.

Written by the JWorld team from our game design documents and measured play data, with AI tools helping with the writing.

More posts

How Stitch Hoop makes its pictures: seven picture checks and boards that always solve

Every Stitch Hoop picture and board is tested before you see it. The seven rules that reject a picture, how needles are built, how a solver proves a board can be won, and the size of Today's picture.

devStitch Hooppuzzle game

What the tavern earns while you are away: how Dokkaebi Tavern pays your time off

How Dokkaebi Tavern turns the time the app was closed into coins. The 4-hour cap, what happens if the clock goes backwards, why helpers matter, and every way to stretch the cap, with the in-game names.

devDokkaebi Tavernidle games

"Hanseong Case Files Guide: Filling the Verdict, the Hint Ladder and the Daily Grid"

How picking up words and filling blanks works, what three tries and the retrial wait mean, how the three hints are priced, what earns the top grade, and how to solve the daily logic grid.

guideHanseong Case Filesdeduction

"Same shot, same result" in Putt Workshop: integer shots, a 240 Hz tick, physics with no dice

How Putt Workshop makes puzzles solvable by thinking instead of luck. Two-integer shots, a fixed time step, friction and cup rules, home-made sin/cos, hash checks, and how a solver sets par.

devPutt Workshopphysics