oke so im trying to make a script ( on a website ) that will solve my unbreakable sudoku puzzle.
so ive got 9 "fields" with in each 9 "boxes"in which the numbers will come. every box has an X and Y coordinate. when you choose a number you want to take and click on the box you want to place the number in every box with the same X coordinate and every box with the same Y coordinate will get the color red. This will leave all the other options where you can place the same number white. After each time you placed a number it will go through each "field" and look how many white spaces there are. If there is only 1 white space it will automaticly place the number in there. Now this is where i need the help:
When in the same field you have only 2 or 3 options ( with color white ), and they have the same X or Y coordinate that means all the other free options left with the same X or Y coordinate will not be able to used anymore. So these have to get color red, and the 2 or 3 that were open will stay white.
In the blue boxes there has to come a 2, which means that in the yellow one there cant be a 2, so that one has to become red ( and the blue ones are going to be white ).
This story has to be translated into code... and haven't figured out how to yet. so if anybody could help me with this please?
so ive got 9 "fields" with in each 9 "boxes"in which the numbers will come. every box has an X and Y coordinate. when you choose a number you want to take and click on the box you want to place the number in every box with the same X coordinate and every box with the same Y coordinate will get the color red. This will leave all the other options where you can place the same number white. After each time you placed a number it will go through each "field" and look how many white spaces there are. If there is only 1 white space it will automaticly place the number in there. Now this is where i need the help:
When in the same field you have only 2 or 3 options ( with color white ), and they have the same X or Y coordinate that means all the other free options left with the same X or Y coordinate will not be able to used anymore. So these have to get color red, and the 2 or 3 that were open will stay white.

In the blue boxes there has to come a 2, which means that in the yellow one there cant be a 2, so that one has to become red ( and the blue ones are going to be white ).
This story has to be translated into code... and haven't figured out how to yet. so if anybody could help me with this please?
