I have those grids:
http://img62.imagesh...okubg4x4jx9.png
http://img218.images...okubg6x6ib7.jpg
http://img80.imagesh...okubg9x9zm6.jpg
And i want to make a loop that read the number from the grid[x][y] and put it in the correct position (centralized) in the grid square...
Naturally we could make this: theX * cellSize... but we have the thin lines and the big lines, that influences the position...
The position has to be: sudokuBoardX + (gridX * cellSize) + bigLinesOffset + thinLinesOffset; so it will be exactly in the square position, thats what i want =)
So my problem is: how to calculate the lines offset so i can draw the numbers in the correct position in the grid?
I have been talking to many programmer friends as i could, but i did not understand how to solve it (its my third day trying =/ )...
I need a solution to use on images, not to draw the lines or stuff like that
The grid have some variables: cellSize, lineInterval (number of blocks in each division, in the case of the 9 x 9 grid, the interval is 3, because it is divided in a series of 3 x 3 blocks), the big line width and the thin line width, and i have all of these in my SudokuGrid class. I just need some clues about how to calculate the line offset so i can draw the number perfectly (depending on the position in the grid).
I am using C++
Thanks a lot!











