Sunday, December 13, 2009

Step 2


Step 2
Originally uploaded by dima.barashkov
Set up simple solving logic of setting Cell's values and eliminating row/column candidates when a value is set.

Onto group logic.
First step would be to make a simple algorithm for generating possible group solutions. Ex. a 2-count group of "5+" would be either 1+4, or 2+3, or a 3-count group of "7+" would be 1+2+4, or 1+3+3.

  • since the number of parts to split a sum(or other action) is variable - have a List of possibles initialized to 1
  • the order is irrelevant so far, so a 1,3,2 solution values is same as 3,2,1
  • for addition, while the sum of parts is less than needed value
  • increment last most value by one, and check if it fits
  • when value has reached to highest board allowed values' transitions should follow like so: On a board size 4 when going from (1,2,4) next should be (1,3,3)

No comments:

Post a Comment

CodeBlocks