A web-based hint system for the DragonFjord "A-Puzzle-A-Day" puzzle. Instead of showing full solutions, it lets you progressively reveal hints by placing one piece at a time.
Live Site: https://www.puzzleadayhint.com (or https://icy-moss-05a1e991e.6.azurestaticapps.net)
- Select any date (month + day) to find all valid solutions
- Click a piece to see where it can be placed (highlighted in green)
- Place pieces one at a time - solutions filter as you go
- Shows count of remaining solutions after each placement
- Mobile-friendly responsive design
- Fast solver using bitmask operations (~50-200ms per date)
The A-Puzzle-A-Day puzzle has:
- Board: 7x7 grid with 6 blocked cells (43 usable cells)
- 8 Pieces: 1 rectangle (6 cells) + 7 pentominoes (5 cells each) = 41 cells
- Goal: Cover all cells except the current month and day
puzzle-hint-generator/
├── index.html # Single-file app (HTML + CSS + JS)
├── staticwebapp.config.json # Azure Static Web Apps config
├── README.md # This file
└── .github/
└── workflows/
└── azure-static-web-apps-icy-moss-05a1e991e.yml # Auto-deploy workflow
Just open index.html in a browser - no build step or server needed.
# Or use a local server
npx serve .The site auto-deploys to Azure Static Web Apps on every push to master.
# Get deployment token from Azure
az staticwebapp secrets list --name puzzleadayhint --resource-group Puzzleadayhint_group --query "properties.apiKey" -o tsv
# Deploy
swa deploy . --deployment-token "<token>" --env production- Resource Group:
Puzzleadayhint_group - Static Web App:
puzzleadayhint - Region: West US 2
- SKU: Free
- GitHub Repo: https://github.com/TheLineExp/puzzleadayhint
www.puzzleadayhint.com- CNAME toicy-moss-05a1e991e.6.azurestaticapps.netpuzzleadayhint.com- Requires TXT validation for apex domain
| Type | Name | Value |
|---|---|---|
| CNAME | www | icy-moss-05a1e991e.6.azurestaticapps.net |
| ALIAS | @ | icy-moss-05a1e991e.6.azurestaticapps.net |
For apex domain validation:
az staticwebapp hostname show -n puzzleadayhint -g Puzzleadayhint_group --hostname puzzleadayhint.com --query "validationToken"Add returned value as TXT record at @.
8 pieces defined as coordinate arrays, with rotations/reflections auto-generated:
const PIECE_BASES = [
{ name: 'Rectangle', base: [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2]], reflect: false },
{ name: 'U-shape', base: [[0,0],[0,1],[1,0],[2,0],[2,1]], reflect: false },
{ name: 'Corner', base: [[0,0],[0,1],[0,2],[1,0],[2,0]], reflect: false },
{ name: 'S-shape', base: [[0,0],[1,0],[1,1],[2,1],[3,1]], reflect: true },
{ name: 'L-shape', base: [[0,0],[1,0],[2,0],[3,0],[3,1]], reflect: true },
{ name: 'Z-shape', base: [[0,0],[0,1],[1,1],[2,1],[2,2]], reflect: true },
{ name: 'T-shape', base: [[0,0],[0,1],[0,2],[0,3],[1,1]], reflect: true },
{ name: 'P-shape', base: [[0,0],[0,1],[1,0],[1,1],[2,0]], reflect: true }
];- Bitmask representation: Board state as 64-bit BigInt for O(1) collision detection
- Pre-computed placements: All valid positions for each piece orientation calculated once
- Pruning: Flood-fill detects isolated regions too small for remaining pieces
- Backtracking: Recursive search through all piece placements
| Function | Description |
|---|---|
findAllSolutions(month, day) |
Returns array of all valid solutions |
generateOrientations(shape) |
Creates all rotations/reflections of a piece |
hasIsolatedRegion(board) |
Pruning check for unsolvable states |
showValidPlacements(pieceIdx) |
Highlights valid cells for selected piece |
placePiece(pieceIdx, placement) |
Places piece and filters remaining solutions |
Edit PIECE_BASES array in index.html (around line 242)
Edit CSS variables and .color-N classes (lines 8-169)
Edit BOARD_LABELS and BLOCKED arrays (lines 185-196)
Edit @media queries at end of <style> block (lines 171-196)
- Check piece definitions total 41 cells
- Verify blocked cells leave 43 usable cells
- Ensure target date cells are valid
- Check GitHub Actions logs: https://github.com/TheLineExp/puzzleadayhint/actions
- Verify
app_location: "/"in workflow file - Ensure deployment token is valid
- DNS propagation can take up to 48 hours
- Verify CNAME points to correct Azure hostname
- Check Azure Portal for validation status