53 lines
2.4 KiB
Markdown
53 lines
2.4 KiB
Markdown
---
|
|
layout: post
|
|
title: Daily Nonogram
|
|
date: 2021-02-21 07:04:23-0400
|
|
categories:
|
|
tags: [announcement, puzzle]
|
|
summary: Announcing a daily puzzle
|
|
thumbnail: /blog/assets/daily-nonogram.png
|
|
offset: -31%
|
|
---
|
|
|
|
As I mentioned during this week's [developer journal]({% post_url 2021-02-15-president %}), I have a minor announcement to make.
|
|
|
|
![A solved nonogram](/blog/assets/daily-nonogram.png "A solved nonogram")
|
|
|
|
It might be a bit shaky until I get the nightly script right, and there's nothing like a scoreboard or mitigation against cheating, but for people who want to try out the [**Picture to Nonogram**](https://github.com/jcolag/picture-nonogram/) generated puzzles, I now post a daily puzzle at <https://john.colagioia.net/nono/>.
|
|
|
|
The styling is a variation of the main site/blog, which was always my intention with the color scheme, but never found a place to do that.
|
|
|
|
Prior puzzles are archived in subfolders named after the date in YYYYMMDD format, so you can find Friday's at <https://john.colagioia.net/nono/20210219/>, for example, and I'll eventually put up a generated archive page for easier access.
|
|
|
|
## How to Play
|
|
|
|
If you're not familiar with solving these puzzles, the numbers in the margins are the consecutive runs of dark squares. Assuming that the picture has the right light/dark balance, it should be straightforward to compare the vertical and horizontal runs to find many of the intersection points, which should suggest where some in-between pixels go, hopefully providing further information.
|
|
|
|
Cells that are light can both be marked as light or unmarked to be correct.
|
|
|
|
For more information, Wikipedia's [article on the puzzle]() has some more detail.
|
|
|
|
## Cheating
|
|
|
|
If you need an occasional *huge* hint, you can run the following code in the developer console.
|
|
|
|
```JavaScript
|
|
grid
|
|
.map((row) => row
|
|
.map((cell) => [
|
|
1 - cell[0],
|
|
cell.length > 1 ? cell.slice(-1)[0] : -1
|
|
])
|
|
)
|
|
.map((row) => row
|
|
.map((cell) => cell[0] === cell[1] || (cell[0] === 0 && cell[1] < 0))
|
|
)
|
|
.map((row) => row.filter((cell) => !cell))
|
|
.filter((row) => row.length > 0);
|
|
```
|
|
|
|
This will return an item for each unsolved row, where each item counts the number of cells that aren't right. It doesn't point to a solution, but it should be enough information to guide you to the solution, especially in cases where the puzzle is legitimately ambiguous.
|
|
|
|
* * *
|
|
|
|
**Credits**: No actual credits; the header image is just a screenshot of a solved puzzle.
|