CodingTrain / CodingTrain/Suggestion-Box
Coding challenge: Nonogram solver
- Dominant language
- No language data
- Stars
- 570
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
I want to propose an idea for griddlers (nonogram, japan crosswords) solver:
by example - we have a array of unknown-colored elements, and
we have a rules (and maybe some elements known) to fill it.
solving process is to make a rearrange a temporary arrays, like a ... dunno...
like a some dresses into closet, or bones on abacus.
By example: stroke 2,2,5,1, length 15.
make this: oo.oo.xxxxxxx.o, what mean, element "5" is some on region xxxxxxx.
It means, we overlap two max-min cases of placing a element, and we have a
two variants: oooooxx and xxooooo. By logic AND we have a result of this:
in this region some elements are known (always black) - "xxBBBxx".
Then we make this for all elements, which are bigger than difference between (sum lengths of elements plus spaces between, in that case is 13) and overall length of array (15). It mean, in that case it's only work for element "5", other are shorter. But it only on beginning, while it not filled.
Maybe, in next steps need to cut array to subarrays and make a same operation for subsets of elements, recursively. Do it at all rows/columns, and remove elements, when count of B at current
row/column exceeded, and we have a correct solver. Some other things also -
make a some sign * for columns/rows, where points is some changed,
and make a queye for check them, or something similar.
Also, all process of solving may be animated, by some shift/shadows, or tilt crucial parts maybe.
some example of griddlers:
https://d1u1p2xjjiahg3.cloudfront.net/f98dd387-e430-454a-a10a-a682b702aa75_l.gif
P.S. Sorry for language, it's not my native )))
P.P.S. Here is a link for some more techniques ( https://en.wikipedia.org/wiki/Nonogram ), chapter Solving Techniques.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.