Nonoblock: Difference between revisions

Add an algorithm.
m (Added a space in the D output)
(Add an algorithm.)
Line 49:
 
Would also work.
 
;An algorithm:
* Find the minimum space to the right that is needed to legally hold all but the leftmost block of cells (with a space between blocks remember).
* The leftmost cell can legitimately be placed in all positions from the LHS up to a RH position that allows enough room for the rest of the blocks.
* for each position of the LH block recursively compute the position of the rest of the blocks in the ''remaining'' space to the right of the current placement of the LH block.
(This is the algorithm used in the [[Nonoblock#Python]] solution).
 
;Reference:
* The blog post [http://paddy3118.blogspot.co.uk/2014/03/nonogram-puzzle-solver-part-1.html Nonogram puzzle solver (part 1)] Inspired this task and donated its [[Nonoblock#Python]] solution.
 
=={{header|D}}==
Anonymous user