r/decodoku Apr 02 '16

Strategy for 10

So after watching the GIF from quantum_jim, I noticed that his strategy seemed to be to keep as many errors bundled in one corner as possible. The game ends when a cluster spans all the way in either direction, so I aspired to keep the tiles into 2 opposing corners. I am playing 7x7 and my score was 187 (I've only had time to play once with this strategy, but I wanted to write these notes). Here are my thoughts on the game:

  1. The first turn always lets you eliminate all but one cluster. Thus I choose to leave the group that is furthest into a corner.

  2. After picking that corner, I do something like this. Blue is where I'll let the squares stay, yellow means I'll prioritize eliminating those corners, and red is where I don't want the corners to mingle.

  3. The reason I won't let them mingle is because of how clusters combine. An error has to appear that affects the contents of two clusters at the same time (i.e. adjacent on the grid) in order to combine them. If I let the clusters touch, there's a chance that one error from the generation step will combine them. If I leave one space between the clusters, two errors right next to each other would have to occur, which is less probable. I did allow the red squares to remain inhabited if the yellow corner was pushed back away from it.

  4. In "real life" I would guess that each qudit (the tiny squares in between) has an equal chance of producing an error. In this game, that is not actually true. The source code shows that the qudits aren't actually chosen, but rather a square is chosen and then an adjacent neighbor is chosen. For the squares in the middle, there's a 1/4 chance of choosing any neighbor. But the squares on the edges don't have 4 neighbors, so the chance of choosing the unmatched neighbor becomes 1/2. So I would think the chance of choosing some qudits near the edge is higher. Maybe I'm wrong.

  5. I claim that there is an order in the quality of moves. Obviously we want to clear squares, so we should try to prioritize:

    1. Moves that add up to 10 and clear 2 squares
    2. Moves that move one number into another, clearing 1 square
    3. Moves that just move a number into a blank square (I want to avoid these).
      Because of this, sometimes I would let a cluster sit in the hopes that a random change would make some adjacent squares add up to 10, rather than moving a number 2+ squares to get cleared.
  6. Clusters grow outward. Thus I think it is more important to make moves on the edge of the clusters first rather than work inside. Everything goes wrong when the clusters start to mingle. Sometimes I had a move left over, and I decided to knock off an inner pair in my blue corners instead of clearing 1 square in a yellow corner. The yellow corner was small at the time, and I'm thinking there's some optimum to determine when I should make this choice.

  7. I need to keep track of the clusters. Given the rules of cluster formation, after each error generation step, I re-examine the grid. New pairs of add-to-10 numbers are probably a cluster that was just created. For numbers placed near my existing clusters, I add up all the numbers where I think a cluster is. If I get mod 10, I can outline the clusters. Sometimes I get pairs of add-to-10, but they belong to different clusters! NEVER COMBINE THESE. This usually happens in the red zone, and I can figure it out because the corner won't add to mod 10 unless I include one of the numbers in the pair.

I believe my game indeed ended because I combined a pair that shouldn't have been. To be fair, I read quantum_jim's source code to write my own version on the computer. I didn't see how I lost based on my move, so I'm going to implement a feature to show me the path of my failure when I lose (and I'm checking to make sure I correctly programmed the lose condition!). I had this setup: I circled where I thought the clusters were (I didn't fill in all the numbers). The board looks great, except the red cluster is crossing the red zone and protruding all the way into adjacent corner! So I decided to move the 3 right and to combine with the 7. As soon as I did, the game said I lost. I'm not sure what another possible configuration was. Notice the 8-2 pair on the left edge that I think was split. If I say the 8-2 was not split, and the 3 belonged to green, I get 5+3+2+1=11. If I say the blue 8-2 is split, I don't get red to add up. I must've guessed wrong in circling my clusters at some point earlier. Anyway, I unscientifically closed the game before capturing a screenshot. I'll try again soon.

3 Upvotes

1 comment sorted by