Skip to content

The properties of the flexdoku board

Board rows and columns

The image above shows a flexdoku board of size 9: - It has 9 rows numbered 0 to 8 - Each row contains 9 cells - It has 9 columns numbered 0 to 8 - Each row contains 9 cells - It has 81 (9 * 9) cells numbered 0 to 80

We can generalize to say that a board of size size has:

  • size rows numbered 0 to size-1
  • Each row contains size cells
  • size columns numbered 0 to size-1
  • Each column contains size cells
  • size*size cells numbered 0 to size*size - 1

Row numbers

Notice that the first cell in each row is a multiple of 9. In fact,

  • For every cell number in row 0, 9 goes into it 0 times:
    • ex: 7 divided by 9 is 0 with remainder 7
  • For every cell number in row 1, 9 goes into it 1 time:
    • ex: 12 divided by 9 is 1 with remainder 3
  • For every cell in row 8, 9 goes into it 8 times:
    • ex: 73 divided by 9 is 8 with remainder 1

Row values

As we noted, rows start on multiples of 9 (size), and the indexes in the row increase by 1.

  • Row 2 is indexes: 18 (2*9), 19, 20, 21, 22, 23, 24, 25, 26

Column numbers

From the previous examples, you may have noticed that the remainder was the same as the column number: - Every cell number in column 1 can be divided by 9 with remainder 1: - ex: 73 divided by 9 is 8 with remainder 1 - Every cell number in column 3 can be divided by 9 with remainder 3: - ex: 12 divided by 9 is 1 with remainder 3 - Every cell number in column 7 can be divided by 9 with remainder 7: - ex: 7 divided by 9 is 0 with remainder 7

Column values

Each starts on the index equal to the column number (column 4 starts with index 4) and each successive index in the column is found by adding 9 (size) to the previous index.

  • Column 2 is (2, 11 (2 + 9), 20 (11 + 9), 29, 38, 47, 56, 65, 74

Block numbers

The reason a flexdoku board size must be a perfect square is that the board must be able to be divided into size blocks which each contain size cells. The rules of flexdoku say that in every row, every column, and every block, each of the size markers (letters or digits) can only appear once.

For example, in a flexdoku board of size 9, we use the 9 letters: A, B, C, D, E, F, G, H, I as markers. The letter A may only appear once in every row, column and block.

Board block

A flexdoku board of size 9 contains the 9 blocks shown in the image above. They may be considered to be numbered 0 to 8 in 1 dimension, or to (0,0) to (2,2) in 2 dimensions. The discussion below relates to their positions in 2 dimensions: (blockrow, blockcol).

Block rows and columns

There are 3 block rows and block columns, each numbered 0 to 2. Note that 3 is the square root of 9, so we can generalize that there are sqrt(size) block rows and block columns, each set numbered 0 to sqrt(size)-1.

For size 9:

  • Block row 0 contains rows 0 to 2
  • Block row 1 contains rows 3 to 5
  • Block row 2 contains rows 6 to 8
  • Block column 0 contains columns 0 to 2
  • Block column 1 contains columns 3 to 5
  • Block column 2 contains columns 6 to 8

Notice that dividing the row number by 3 (ignoring the remainder) gives us the block row number. The same is true for translating a column number into a block column number.

So for any cell index, we can know the block, for example:

  • Cell 58 is in position (6, 4) which is in block (2, 1) because
    • 6 divided by 3 is 2
    • 4 divided by 3 is 1
  • Cell 16 is in position (1, 7) which is in block (0, 2) because
    • 1 divided by 3 is 0
    • 7 divided by 3 is 2

Block values

A block starts at its top left index, notice that:

  • The top left corners of the blocks in block row 0 fall in board row 0 (0*3).
  • The top left corners of the blocks in block row 1 fall in board row 3 (1*3).
  • The top left corners of the blocks in block row 2 fall in board row 6 (2*3).

Note the relationship to 3, or the sqrt(size).

  • The top left corners of the blocks in block column 0 start 0 (0*3) past the beginning of row 0.
  • The top left corners of the blocks in block column 1 start 3 (1*3) past the beginning of row 1.
  • The top left corners of the blocks in block column 2 start 6 (2*3) past the beginning of row 2.

Note the relationship to 3, or the sqrt(size).

Some examples:

  • Block (0, 2) starts at index (0 * 3 * 9) + (2 * 3) (6 past the beginning of row 0, which is index 0)
  • Block (2, 0) starts at index (2 * 3 * 9) + (0 * 3) (0 past the beginning of row 6, which is index 54)
  • Block (1, 1) starts at index (1 * 3 * 9) + (1 * 3) (3 past the beginning of row 3, which is index 27)

To get the values in a block: get 3 consecutive values starting at the top left index, add 9 to the top left index and get 3 more values, add 9 again and get 3 more values.

Note that 9 is the size and 3 is the sqrt(size).