falosing.blogg.se

Sudoku (Oh no! Another one!) download the new for android
Sudoku (Oh no! Another one!) download the new for android









I loop through the foundNumber array, which has a size of squareExp2, to find every 0. I already explained how the first three loops are working, so I will start explaining from the " count = 0" line. When I was doing benchmarking, they seem to be the best numbers so far, but if you find others, let me know.įoundNumber(grid(myGridbox(x))) = grid(myGridbox(x))įoundNumber(x) = 0 Next If count > 1 Then When that is done, the main loop counter will change so it can continue to fill the grid. If there was no possible number in the previous position, the code will check to see how many times it entered the backtracking logic for the current grid, and if it was, for an example with a 9x9 grid 10 times, it will check what is the current position ( i) to make sure it won't go into a negative value and remove, for the same 9x9 grid, a maximum of 16 numbers if it was less than 10 times, it would just remove 7 numbers.

Sudoku (Oh no! Another one!) download the new for android

I -= squareExp2 - 2 End If For j = i To xĬount shows how many possibilities were in the previous position, and I initialize it to one so it won't enter when I start the loop. To get every number inside a row, based on a position (which is i in these examples): Why do all these steps to fill these arrays? To be able to use them this way: I2_interleaved_offset + j1_interleaved_offset

Sudoku (Oh no! Another one!) download the new for android

Offset_value = j_offset_value + i2_offset J1_interleaved_offset = 0 For j1 As Integer = 0 To iSquare - 1

Sudoku (Oh no! Another one!) download the new for android

Dim box As Integer Dim Square2 As Integer = iSquare * iSquareĭim Square3 As Integer = Square2 * iSquareĭim Square4 As Integer = Square2 * Square2ĭim j2_offset As Integer, j1_offset As Integer Dim j1_interleaved_offset As Integer, i2_offset As Integer Dim i2_interleaved_offset As Integer, j_offset_value As Integer Dim offset_value As Integer, interleaved_value As Integer For j2 As Integer = 0 To iSquare - 1











Sudoku (Oh no! Another one!) download the new for android