Schema Sudoku 9x9 da Clipboard

Schema Sudoku 9x9 da Clipboard

 

Nel "risolutore standard 9x9", nel "Sudoku 9x9 Normal & Disjoint Groups & Windoku Solver" e nel "Sudoku 9x9 Logic Solver & Report Builder" è presente una macro, da lanciare con apposito pulsante, che facilita l'importazione in Excel di schemi proposti in formato testo.

Il codice acquisisce gli appunti di Windows in una variabile "DataObject" ed estrae dal testo tutti i caratteri numerici da 1 a 9, considerandoli validi come inserimenti iniziali nello schema da risolvere, e considera inoltre una serie di caratteri separatori possibili come riferimenti per le celle vuote iniziali.

Ovviamente il conteggio dei numeri da 1 a 9 + separatori deve essere uguale a 81.

Dalla versione della macro inclusa nei risolutori datati - v 2007 11 22 - e seguenti, i separatori ammessi sono:

La macro segnala un errore se non conta 81 caratteri tra numeri e separatori, se gli appunti di Windows non sono in formato testo e se non trova nulla negli appunti di Windows (cioè se l'icona "Incolla" di Excel non è attiva).

In pratica basta selezionare un testo che rappresenta uno schema Sudoku 9x9 da un qualsiasi file o pagina web, copiarlo negli appunti (con il classico "CTRL + C" o comando "Copia" da tasto destro etc.) e lanciare la macro: lo schema sarà importato nel foglio Excel.

Di seguito sono incollati alcuni tipi di schema in formato testo, tratti da internet, che si possono importare: potrebbero però esistere altri tipi, l'importante è che il conteggio numeri + separatori sia uguale a 81.

La macro non importa schemi alfabetici.

 

000060030000800200200500000000290500076000000000000100000007064500000000000000070

 

4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......

 

 .3...1...|..6....5.|5.....983|.8...63.2|....5....|9.38...6.|714.....9|32....8..|...4...3.

 

1----4--97--2---4-----73--8-4--2--3--6-----1-------284-----1-738---3--5---6-4--9-

 

91x7xxxxxx326x9x8xxx7x8x9xxx86x3x17x3xxxxxxx6x51x2x84xxx9x5x3xxx2x3x149xxxxxx2x61

 

+-------+-------+-------+
| . 6 . | . . . | . 7 . |
| . . . | 3 . 5 | . . . |
| 3 1 . | 4 . 6 | . 8 9 |
+-------+-------+-------+
| . 4 2 | . . . | 7 9 . |
| . . . | 1 . 7 | . . . |
| . 9 1 | . . . | 5 6 . |
+-------+-------+-------+
| 4 2 . | 8 . 9 | . 5 6 |
| . . . | 5 . 2 | . . . |
| . 3 . | . . . | . 4 . |
+-------+-------+-------+

 

 ------- ------- -------
| . . . | . 7 . | 9 4 . |
| . . . | . 9 . | . . 5 |
| 3 . . | . . 5 | . 7 . |
 ------- ------- -------
| . . 7 | 4 . . | 1 . . |
| 4 6 3 | . . . | . . . |
| . . . | . . 7 | . 8 . |
 ------- ------- -------
| 8 . . | . . . | . . . |
| 7 . . | . . . | . 2 8 |
| . 5 . | 2 6 . | . . . |
 ------- ------- -------

 

| 3 . 5 | 2 . 8 | 9 . 4 |
| . 8 7 | 9 . 4 | 1 6 . |
| 9 6 . | 3 . 1 | . 2 5 |
+-------+-------+-------+
| 5 9 8 | . . . | 3 1 2 |
| . . . | . . . | . . . |
| 1 2 3 | . . . | 7 4 6 |
+-------+-------+-------+
| 8 3 . | 4 . 6 | . 5 7 |
| . 4 2 | 5 . 9 | 6 3 . |
| 6 . 1 | 7 . 3 | 4 . 8 | 

 

| . 9 . | 4 . 1 | . . . |
| . 1 3 | . . . | . 4 8 |
| . . 2 | . . . | 5 1 . |
| 5 . . | 7 . 8 | . . 1 |
| . . . | . 4 . | . . . |
| 8 . . | 1 . 6 | . . 9 |
| . 3 4 | . . . | 1 . . |
| 9 5 . | . . . | 7 3 . |
| . . . | 3 . 5 | . 9 . |

 

 . . . | 5 . 3 | . . . 
 4 . 5 | 1 . 2 | 3 . 9 
 6 . 3 | . . . | 1 . 2 
-------+-------+------
 . 1 . | 2 . 9 | . 8 . 
 . . . | . 1 . | . . . 
 . 5 . | 7 . 4 | . 9 . 
-------+-------+------
 7 . 9 | . . . | 8 . 4 
 8 . 4 | 6 . 1 | 2 . 5 
 . . . | 4 . 7 | . . . 

 

 9 . .  . . .  . . 5
. 1 .  . . .  . 9 .
. 2 .  1 . 6  . 4 .

. . 5  9 . 4  3 . .
7 . .  . 5 .  . . 2
. 6 .  . . .  . 1 .

1 4 .  . . .  . 6 7
. . .  3 . 2  . . .
. . .  . . .  . . .

 

2.. ..4 ..8
48. .2. ..3
..6 ..3 2..

7.. .9. ..1
1.. ..7 .65
..5 .3. 4..

..9 ... 7..
..8 4.9 .3.
.7. 85. 9..

 

5 . 2 . . . 4 . .
. . . 7 1 . . . 3
. . . . . . . . .
. . . . . 4 6 . .
. 7 . 2 . . . . .
. 1 . . . . . . .
6 . . . . 2 . . .
. . . . 3 . . 1 .
4 . . . . . . . .

 

 ..1.9....
.2...8.6.
..3...7.5
.4...6...
5.......6
...1...7.
6.8...4..
.7.9...3.
....1.2..

 

*-----------------*
|. 3 .|8 5 4|. 1 .|
|4 . 5|. . .|7 . 6|
|. 9 .|. 1 .|. 5 .|
|-----+-----+-----|
|8 . .|6 . 3|. . 2|
|3 . 9|. . .|5 . 8|
|6 . .|5 . 2|. . 1|
|-----+-----+-----|
|. 8 .|. 7 .|. 4 .|
|1 . 4|. . .|8 . 3|
|. 6 .|4 2 8|. 9 .|
*-----------------*

 

*-----------*
|84.|...|..5|
|...|.6.|..3|
|...|3.7|...|
|---+---+---|
|..5|4.8|3..|
|.1.|...|.8.|
|..6|1.3|7..|
|---+---+---|
|...|6.4|...|
|9..|.2.|...|
|5..|...|.24|
*-----------*

 

 --- --- ---
|...|.7.|94.|
|...|.9.|..5|
|3..|..5|.7.|
 --- --- ---
|..7|4..|1..|
|463|...|...|
|...|..7|.8.|
 --- --- ---
|8..|...|...|
|7..|...|.28|
|.5.|26.|...|
 --- --- ---

 

...|...|...
...|1.2|...
3.4|...|5.6
---+---+---
.1.|.2.|.4.
57.|...|.81
.9.|.6.|.2.
---+---+---
1.8|...|4.9
...|6.7|...
...|...|...

 

"8156....4/" +
"6...75.8./" +
"....9..../" +
"9...417../" +
".4.....2./" +
"..623...8/" +
"....5..../" +
".5.91...6/" +
"1....7895";

 

1 0 0 8 0 0 0 3 0
7 0 0 0 0 0 0 2 0
0 0 0 5 6 0 0 7 0

0 0 8 0 0 0 9 0 0
0 0 5 2 1 7 4 0 0
0 0 4 0 0 0 7 0 0

0 3 0 0 8 9 0 0 0
0 2 0 0 0 0 0 0 8
0 8 0 0 0 4 0 0 6

 

000|000|012
700|060|000
000|000|050
-----------
080|200|000
600|000|400
000|109|000
-----------
019|000|000
000|030|800
502|000|000

 

006 408 003
075 100 020
004 000 007

000 003 000
100 050 904
058 007 002

500 009 100
081 000 700
647 080 000

 

000 395 000
005 008 902
000 020 005
602 000 007
084 000 530
700 000 106
300 060 000
506 200 700
000 831 000

 

={{8,0,4,5,0,0,6,0,0},
 {0,2,9,6,7,0,0,1,0},
 {0,0,0,0,1,4,0,5,0},
 {6,0,0,3,9,1,5,0,2},
 {0,5,1,0,0,0,9,0,0},
 {9,0,2,0,0,6,0,0,0},
 {0,6,0,4,3,0,0,0,0},
 {0,9,0,0,8,7,1,6,0},
 {0,0,7,0,0,0,0,0,3}};

 

[5 0 0 0 8 0 0 4 9]
[0 0 0 5 0 0 0 3 0]
[0 6 7 3 0 0 0 0 1]
[1 5 0 0 0 0 0 0 0]
[0 0 0 2 0 8 0 0 0]
[0 0 0 0 0 0 0 1 8]
[7 0 0 0 0 4 1 5 0]
[0 3 0 0 0 2 0 0 0]
[4 9 0 0 5 0 0 0 3]

 

<< "0 0 0 0 4 0 0 5 2\n"
<< "0 6 9 7 0 0 0 0 8\n"
<< "0 3 0 8 0 0 0 0 0\n"
<< "0 0 0 0 0 0 1 0 3\n"
<< "0 7 5 0 3 0 2 4 0\n"
<< "3 0 6 0 0 0 0 0 0\n"
<< "0 0 0 0 0 7 0 8 0\n"
<< "9 0 0 0 0 4 3 1 0\n"
<< "7 8 0 0 9 0 0 0 0\n\n"

 

0 0 0 1 0 7 0 0 0
0 7 0 0 2 0 0 5 0
2 1 0 0 0 0 0 6 7
0 0 7 4 0 3 6 0 0
8 0 0 0 0 0 0 0 3
0 0 1 6 0 2 7 0 0
4 8 0 0 0 0 0 7 6
0 9 0 0 6 0 0 2 0
0 0 0 9 0 5 0 0 0

 

003020600
900305001
001806400
008102900
700000008
006708200
002609500
800203009
005010300

 

((0 0 0 0 0 6 0 8 0) (0 1 0 0 2 0 6 0 0) (8 0 0 0 0 1 0 0 2) (3 0
0 0 0 0 0 1 7) (0 4 0 3 0 5 0 2 0) (7 6 0 0 0 0 0 0 8) (4 0 0 7 0
0 0 0 5) (0 0 2 0 4 0 0 6 0) (0 3 0 5 0 0 0 0 0))

 

=========================
| X X 8 | 1 X 2 | 3 X X |
| X X X | X 6 X | X X X |
| 2 9 X | 3 X 7 | X 6 4 |
=========================
| X 2 3 | X X X | 8 1 X |
| 7 X X | X X X | X X 2 |
| X 5 9 | X X X | 4 7 X |
=========================
| 1 3 X | 6 X 9 | X 8 5 |
| X X X | X 4 X | X X X |
| X X 6 | 5 X 3 | 7 X X |
=========================

 

--------------------------
| x x x | 4 2 x | x x 7 |
| x 7 2 | 1 8 6 | 5 3 x |
| x x x | 7 5 x | x 2 x |
--------------------------
| x x x | 6 4 2 | 3 7 x |
| 2 x x | 5 7 1 | 8 x x |
| x 6 7 | 9 3 8 | x 5 2 |
--------------------------
| 7 x x | 8 6 4 | 2 9 3 |
| 6 2 9 | 3 1 5 | 7 x x |
| 3 4 8 | 2 9 7 | 6 1 5 |
--------------------------

 

2 1 4 | 3 x x | x 9 x
x x 3 | 4 x x | 8 x x
6 8 x | x x 2 | x 3 4
-----------------------
x x x | x 2 6 | x x 7
x x 6 | 7 4 x | 5 x x
4 7 2 | 8 5 x | x 6 x
-----------------------
3 2 x | x x x | x x 9
x 4 8 | x x 7 | 2 5 x
x 6 x | 2 x 4 | x 1 8

 

x x 2 9 x 8 7 x x

x x x x 3 x x x x

5 x 3 7 x 1 9 x 2

3 x 5 x x x 8 x 7

x 9 x x x x x 1 x

6 x 1 x x x 2 x 5

2 x 9 8 x 3 1 x 6

x x x x 9 x x x x

x x 8 2 x 4 3 x x

 

x32|xxx|95x
xxx|5x4|3xx
xx5|3xx|1x6
-----------
598|47x|6xx
7x3|659|4x8
xx6|x3x|795
-----------
3x4|xx5|8xx
xxx|1x6|5xx
x51|xx3|2xx

 

19X X83 2XX
4XX XXX XXX
XXX XX1 84X

32X XXX XXX
XXX 867 XXX
XXX XXX X54

X78 3XX XXX
XXX XXX XX9
XX9 67X X28

 

xxx 1xx 67x
x1x 3x6 2x4
6x5 4xx 1xx
x83 x6x xx2
56x xxx 3x8
1xx x3x 76x
x51 6x3 427
2xx 5xx xx6
x76 x42 xx1

 

X6X1X4X5X
XX83X56XX
2XXXXXXX1
8XX4X7XX6
XX6XXX3XX
7XX9X1XX4
5XXXXXXX2
XX72X69XX
X4X5X8X7X

 

53xx7xxxx
6xx195xxx
x98xxxx6x
8xxx6xxx3
4xx8x3xx1
7xxx2xxx6
x6xxxx28x
xxx419xx5
xxxx8xx79

 

73- --- -84
8-- --- --1
--2 9-8 7--
          
--1 2-7 3--
--- -6- ---
--7 3-1 5--
          
--4 6-5 2--
9-- --- --5
25- --- -39

 

7-9-2---4
26-----93
---9-5---
-8--7--61
--6---3--
32--9--5-
---1-2---
19-----75
8---3---6

 

1 _ _  _ 8 _  _ _ 4
_ _ 5  _ _ 7  _ 2 _
3 _ _  _ 2 _  _ 8 5

_ 8 _  3 _ _  _ _ _
9 2 _  _ 5 6  _ _ 7
_ _ 3  _ _ 2  4 _ _

5 _ _  _ 1 _  _ _ 9
_ 3 7  _ _ _  2 _ _
2 _ _  _ 6 _  _ _ 3

 

9 _ 5 _ _ 2 3 7 1
4 1 7 3 5 9 6 8 2
3 _ _ _ 7 _ _ 4 _

1 _ _ _ 8 7 _ _ 4
8 7 _ _ 2 _ 1 3 6
5 _ _ _ 1 3 8 _ 7

2 5 _ _ _ _ 7 _ 3
6 _ 1 7 3 _ 2 _ _
7 _ _ 2 _ _ 4 _ _

 

_ _ 7 _ 2 _ _ 5 _
9 _ _ _ 4 _ _ _ 7
_ 6 2 _ _ _ 4 9 _
_ _ 3 2 _ 9 6 _ _
6 7 _ _ _ _ _ 8 2
_ _ 8 7 _ 4 5 _ _
_ 8 5 _ _ _ 1 3 _
7 _ _ _ 5 3 _ 6 8
_ _ _ _ 9 _ _ _ 5

 

3BB 49B 1BB
2BB BBB 7BB
B6B BB7 BBB

B26 BB8 B9B
5BB BBB BB7
B3B 9BB 84B

BBB 8BB B3B
BB3 BBB BB8
BB4 B51 BB9

 

b27498b3b
b1b2b7bbb
bb4bbb8bb
7b6b4b5b9
bbbbbbbbb
1b2b853b6
bb18732bb
2bb614bbb
b7b529b1b

 

??6 9?? ?7?
??? ?1? ??2
8?? ??? ???

?2? ??? ??4
??? ??? ??1
??5 ??6 ???

??? ??? ?6?
??? ??2 ?5?
?1? ?43 ???

 

146 928 375
5?? 617 842
872 435 916

721 359 684
?68 274 5X1
4?5 186 ?Y?

25? 891 46?
?84 762 15?
61? 543 ??8

 

+ 3 +     + + +     9 + +                   
6 + +     4 + +     + + +                 
+ + +     + + +     7 + +               
 
+ 7 +     2 9 +     + + +               
+ + +     3 + +     + 6 + 
+ + +     + + +     + 4 +                 
 
4 + +     + + 5     + 8 +                 
+ + +     + 7 +     3 + +         
+ + 1     + + +     + + +

 

+ + +  + 7 6  + + +
+ 4 +  + + +  + 9 +
+ 3 +  + + +  + 5 +

+ + +  + + +  7 + 1
+ + 9  2 + +  + + +
8 + +  + + +  6 + +

+ + 5  4 + +  + 3 +
6 + +  + + +  + + +
+ + +  + + +  8 + +