Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Sudoku Program Help

I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place. These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown? Any
suggestions appreciated.


Regards
Gary


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Sudoku Program Help

Hi Gazza,

From my understanding of what you are asking I think that would be the best
solution. You can use the +x,x variables to move the grid around.

I am intrigued by this algorythm - have you got any more details? Sounds
interesting.

ATB

Andy

"Gazza" wrote in message
...
I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place.

These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown?

Any
suggestions appreciated.


Regards
Gary




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Sudoku Program Help

Thanks Andi,

the algorythm will be working the following way:

When a known symbol is entered onto the grid, the associated row, column and
grid of 16 other symbols will be stepped through. Each of the 16 symbol
grids will contain 16 candidates for symbols. Each one of these will have
the corresponding symbol removed from its contents i.e. by process of
elimination, the main symbols cell of 16 candidates should be whittled down
to one eventually. So far I have only got at far as the plain english stage,
just trying to create it stage by stage with code so I can try out my ideas.
As for the complete solution of the puzzle I still have to work on that. For
now this part will speed up the elimination of candidates when the human
mind has decided what the symbol is to be entered.

Thanks again
Gazza

"Andibevan" wrote in message
...
Hi Gazza,

From my understanding of what you are asking I think that would be the
best
solution. You can use the +x,x variables to move the grid around.

I am intrigued by this algorythm - have you got any more details? Sounds
interesting.

ATB

Andy

"Gazza" wrote in message
...
I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place.

These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown?

Any
suggestions appreciated.


Regards
Gary






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Sudoku Program Help

If you want to post your code I would be happy to provide some specific
guidance on putting the square onto the sheet........

Andi

"Gazza" wrote in message
...
Thanks Andi,

the algorythm will be working the following way:

When a known symbol is entered onto the grid, the associated row, column

and
grid of 16 other symbols will be stepped through. Each of the 16 symbol
grids will contain 16 candidates for symbols. Each one of these will have
the corresponding symbol removed from its contents i.e. by process of
elimination, the main symbols cell of 16 candidates should be whittled

down
to one eventually. So far I have only got at far as the plain english

stage,
just trying to create it stage by stage with code so I can try out my

ideas.
As for the complete solution of the puzzle I still have to work on that.

For
now this part will speed up the elimination of candidates when the human
mind has decided what the symbol is to be entered.

Thanks again
Gazza

"Andibevan" wrote in message
...
Hi Gazza,

From my understanding of what you are asking I think that would be the
best
solution. You can use the +x,x variables to move the grid around.

I am intrigued by this algorythm - have you got any more details? Sounds
interesting.

ATB

Andy

"Gazza" wrote in message
...
I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place.

These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown?

Any
suggestions appreciated.


Regards
Gary








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Sudoku Program Help

Just did a google with the correct spelling of Sudoku and found quite a bit.

This web-site provides source code for a Sudoku solver:-

www.di-mgt.com.au/src/sudoku.bas.txt



"Andibevan" wrote in message
...
Hi Gazza,

From my understanding of what you are asking I think that would be the

best
solution. You can use the +x,x variables to move the grid around.

I am intrigued by this algorythm - have you got any more details? Sounds
interesting.

ATB

Andy

"Gazza" wrote in message
...
I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place.

These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown?

Any
suggestions appreciated.


Regards
Gary








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Sudoku Program Help

Here is my first "bash" as it were, at highlighting the 16 candidate cells
to give the impression of one cell. The only problem I have now is that I
have to use the mouse to select anything to the right and down because as
soon as a cursor key is pressed the code is run and the active cell is the
top left.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cRows As Long, cCols As Long
Dim myRange As Range
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''
'This sub highlights a whole grid of 16 candidates when
'a selection is made using the mouse
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

Application.EnableEvents = False
On Error GoTo ws_exit

Set myRange = Range("A1:b64")

cRows = Int((ActiveCell.Row + 3) / 4)
cCols = Int((ActiveCell.Column + 3) / 4)

Application.StatusBar = ""
Application.StatusBar = cRows & " " & cCols

cRows = 4 * (cRows - 1) + 1
cCols = 4 * (cCols - 1) + 1
Set myRange = Range("A1:D4")
myRange.Offset(cRows - 1, cCols - 1).Select

ws_exit:
Application.EnableEvents = True
End Sub

I now need a way of detecting that a key has been pressed i.e. a symbol has
been added. Then I can trigger the code to merge all the 16 cells to one and
make the newly entered symbol large enough to stand out.

Hope you got my meaning.

Regards
Gary

"Andibevan" wrote in message
...
Just did a google with the correct spelling of Sudoku and found quite a
bit.

This web-site provides source code for a Sudoku solver:-

www.di-mgt.com.au/src/sudoku.bas.txt



"Andibevan" wrote in message
...
Hi Gazza,

From my understanding of what you are asking I think that would be the

best
solution. You can use the +x,x variables to move the grid around.

I am intrigued by this algorythm - have you got any more details? Sounds
interesting.

ATB

Andy

"Gazza" wrote in message
...
I am trying to use excel to help solve the big SuperSudoku puzzles for
myself. I am OK with the algorythm but am not sure of the best way to
implement the code to carry out each stage of the process.

In particular I want a grid of six cells to be highlighted each time a
selection change takes place. Each of the sixteen cells represent the
possible candidates for the unique symbol that shall take their place.

These
will be eliminated and the sixteen cells merged to contain the correct
symbol.
This is a section of what I mean as an example.

0 1 2 3 0 1 2 3 4 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F
0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7
8 9 A B 8 9 A B 8 9 A B 8 9 A B
C D E F C D E F C D E F C D E F


Do I use the command myRange.Offset(+X,X) or just some other form of
Range("A1:D4") to move the active range with the grid of 16 as shown?

Any
suggestions appreciated.


Regards
Gary








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Sudoku ernie Excel Discussion (Misc queries) 1 April 14th 10 04:45 AM
Sudoku Danny Lewis Excel Discussion (Misc queries) 1 August 1st 06 01:40 PM
Sudoku Jonathan Cooper Excel Discussion (Misc queries) 2 January 30th 06 10:31 PM
sudoku Wim Rijsdijk Excel Programming 2 August 1st 05 10:11 PM
sudoku Wim Rijsdijk Excel Programming 3 July 31st 05 10:38 PM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"