Tcl/Tk Crossword





# ---------------------------------------------------------
# A Tcl/Tk crossword game. Written by Hattie Schroeder, 1997.
#  Copyright (c) 1997 Eolas Technologies Inc.
#  Freely modifiable/redistributable under the "Standard Tcl License"
#  See http://www.eolas.com/tcl/license.txt for details
# ---------------------------------------------------------

proc right_or_wrong { box letter } {
set entry [ $box get ]
if  {$entry == ""} {
	$box configure  -foreground black
     } elseif  {[regexp -nocase $entry $letter]} {
	$box configure -foreground black
      } else {
	$box configure -background orange
	}
} 
 

proc check_letters {} {
global ID let 
for {set i 1} {$i <=121} {incr i} {
	set box $ID($i)
	set letter $let($i)
	right_or_wrong $box $letter
	}

for {set i 1} {$i <=121} {incr i} {
	set box $ID($i)
	set uplet [string toupper $let($i)]
	set letter $uplet
	right_or_wrong $box $letter
}
}
 
proc check_letter { t } {
global ID let 
set entry [ $ID($t) get ]
set uplet [string toupper $let($t)] 
if {$entry ==$let($t)} {
	 $ID($t) configure -background yellow
		} elseif {$entry ==$uplet} {
	 $ID($t) configure -background yellow
		} elseif {$entry == ""} {
	 $ID($t) configure -background yellow
		} else {
	 $ID($t) configure -background orange
}}	
 

proc erase_entry { t } {
global ID 
$ID($t) icursor 0
$ID($t) delete insert end
}




proc changing_direction { W cluex cluey args } {
global glob_dir
if {$glob_dir == "x"} {
		change_direction_x  $W $cluey $cluex $args
		give_clue $cluey
	 	} else {	
		change_direction_y $W $cluex $cluey $args
		}		
		}


proc give_clue { message } {
if {$message == "****"} {
	.top0.l1 config -foreground white
		} else {
	.top0.l1 config -foreground black 
		}
.top0.l1 config -text $message 
}



proc change_direction_x { W cluex cluey args } {
global glob_dir
give_clue $cluey
empty_all
$W config -background yellow
foreach full_box $args {$full_box config -background pink}
set glob_dir "y"
}


proc change_direction_y { W cluex cluey args } {
global glob_dir
give_clue $cluex
empty_all
if {[$W cget -state] != "disabled"} {$W config -background yellow}
foreach full_box $args {$full_box config -background pink}
set glob_dir "x"
}


proc color_box { W args } {
if {[$W cget -state] != "disabled"} {$W config -background yellow}
foreach full_box $args {$full_box config -background pink}
		}
		


proc empty_box { args } {
foreach white_box $args  {
	if {[$white_box cget -state] != "disabled"} {  
		$white_box config -background white
		}
	}
}

proc empty_all {} {
global ID
for {set i 1} {$i<=121} {incr i} { 
	set box $ID($i)
	empty_box $box
	} 
}





#--------  binding procedures ----------------



proc change_dir { index lengthx positionx cluex lengthy positiony cluey } {
global ID glob_dir
if {$glob_dir == "x"} {
	empty_all
	set glob_dir "y"
	enter_box $index $lengthy $positiony
	give_clue $cluey
	} else {
	empty_all
	set glob_dir "x"
	enter_box $index $lengthx $positionx
	give_clue $cluex
	}
}



proc enter_or_focus { index lengthx positionx cluex lengthy positiony cluey }  {
global ID glob_dir 
set W $ID($index)
bindings $index
if {$glob_dir == "x"} {
	enter_box $index $lengthx $positionx
	give_clue $cluex	
	} else {
	enter_box $index $lengthy $positiony
	give_clue $cluey	
	}
}
		   

proc enter_box { index length position } {
global glob_dir ID
set s $length
set t $index 
set p $position
set W $ID($index)
if {[$W cget -state] != "disabled"} {
	$W config -background yellow
	} else {
	set right $ID([if {$t == 121} {
		expr $t-120
		} else {
		expr $t+1}])
	set down $ID([if {$t>110} {
		expr $t-110
		} else {
		expr $t+11}])  
	return_key $right $down
		}
if {$glob_dir == "x"} {
	for {set i 1} {$i < $p} {incr i}  \
		{set box $ID([expr $t-$i])
		$box config -background pink
		}	
	for {set i 1} {$i <= [expr $s-$p]} {incr i}  \
		{set box $ID([expr $t+$i])
		$box config -background pink
		}
		} else {	
	for {set i 11} {[expr $i/11] < $p} {incr i 11}  \
		{set box $ID([expr $t-$i])
		$box config -background pink
		}
	for {set i 11} {[expr $i/11] <= [expr $s-$p]} {incr i 11}  \
		{set box $ID([expr $t+$i])
		$box config -background pink
		}}
	}



proc next_letter { t } {
global ID let 
set entry [ $ID($t) get ]
set uplet [string toupper $let($t)] 
if {$entry == $let($t)} {
	set right $ID([if {$t == 121} {
		expr $t-120
		} else {
		expr $t+1}])
	set down $ID([if {$t>110} {
		expr $t-110
		} else {
		expr $t+11}])  
	return_key $right $down
	} elseif {$entry == $uplet} {
		set right $ID([if {$t == 121} {
			expr $t-120
			} else {
			expr $t+1}])
		set down $ID([if {$t>110} {
			expr $t-110
			} else {
			expr $t+11}])  
	return_key $right $down
	} else {
  	}}	





proc bindings { index } {
global ID glob_dir
set t $index
set W $ID($index)
set right $ID([if {$t == 121} {
		expr $t-120
		} elseif {[$ID([expr $t+1]) cget -state] == "disabled"} {
		expr $t+2
		} else {
		expr $t+1}])
set left $ID([if {$t == 1}  {
		expr $t+10 
		} elseif {[$ID([expr $t-1]) cget -state] == "disabled"} {
		expr $t-2 
		} else {
		expr $t-1}]) 
set up $ID([if {$t<=11} {
		expr $t+110
		} elseif {[$ID([expr $t-11]) cget -state] == "disabled"} {
			if {$t<=22} {
			   expr $t-10		
			} else {
			 expr $t-22
			} 
		} else {
		expr $t-11}]) 
set down $ID([if {$t>110} {
		expr $t-110
		} elseif {[$ID([expr $t+11]) cget -state] == "disabled"} {
			if {$t>99} {
			   expr $t+12
			} else {				
			   expr $t+22
			}
		} else {
		expr $t+11}])  
bind $W  "return_key $right $down"
bind $W  "return_key $right $down"
bind $W  "focus $right"
bind $W  "focus $left"
bind $W  "focus $down"
bind $W  "focus $up"
}  

proc binds { index lengthx positionx cluex lengthy positiony cluey } {
global ID clue let 

bind $ID($index)   "enter_or_focus  $index $lengthx $positionx $cluex  $lengthy $positiony $cluey "
bind $ID($index)  "change_dir $index  $lengthx $positionx  $cluex $lengthy $positiony  $cluey " 
bind $ID($index)   "change_dir $index  $lengthx $positionx $cluex $lengthy $positiony $cluey "
bind $ID($index)   "change_dir $index  $lengthx $positionx $cluex $lengthy $positiony $cluey "

if { [$ID($index) cget -state] != "disabled" } {
bind $ID($index)   "erase_entry $index"
bind $ID($index)   "next_letter $index"
set uplett [string toupper $let($index)]
bind $ID($index)   "next_letter $index "
bind $ID($index)   "check_letter $index"
}
}



proc return_key { HR VD } {
global glob_dir	
if {$glob_dir == "x"} { 
	focus $HR
        } else  { 
	 focus $VD
	}}





set Name .top0
frame $Name   -background white
pack $Name
set Parent $Name

#--- global variables ------------

set glob_dir "x"


array set clue { 
h0 "****"
h1 "Insect"
h4 "Atomic mass unit"
h6 "The least amount"
h9 "River in central Switzerland"
h10 "Christmas"
h11 "Falsehood"
h12 "Roll of bank notes"
h14 "Highest mountain in Crete"
h15 "Thick slice"
h17 "Instruct"
h18 "Tap gently"
h20 "Organ of hearing"
h22 "Brother of Moses"
h24 "Gist"
h26 "Worthless piece of cloth"
h29 "The intestine"
h31 "False god"
h33 "Fuss"
h34 "Laboratory"
h35 "Brassiere"
h36 "Japanese wooden clog"
h37 "Large wading bird"
h38 "Observation"
h39 "Gave food"
h40 "Yelp"
v0 "****" 
v1 "City in central Belgium" 
v2 "Metal fastener"
v3 "Walk"
v5 "Foss"
v6 "Plant fluid"
v7 "Dated"
v8 "Light meal" 
v13 "Furnishings"
v16 "Bleat of a sheep"
v19 "Confused mixture of sounds"
v21 "Subdebutante"
v23 "Arrest"
v25 "Heavy footwear"
v27 "Garrulous"
v28 "Fastening device"
v30 "Ornamental fabric"
v32 "Melody"
v33 "Gone by"
}



array set let { 
1 a
2 n	
3 t
4 *
5 a
6 m
7 u
8 *
9 j
10 o
11 t
12 a
13 a
14 r
15 e
16 *
17 o
18 *
19 y
20 u
21 l
22 e
23 l
24 i
25 e
26 *
27 w
28 a
29 d
30 *
31 i
32 d
33 a
34 s
35 l
36 a
37 b
38 *
39 t
40 e
41 a
42 c
43 h
44 *
45 t
46 *
47 d
48 a
49 b
50 *
51 c
52 *
53 e
54 a
55 r
56 *
57 s
58 *
59 a
60 a
61 r
62 o
63 n
64 *
65 t
66 *
67 n
68 u
69 b
70 *
71 b
72 *
73 r
74 a
75 g
76 *
77 c
78 *
79 b
80 o
81 w
82 e
83 l
84 *
85 b
86 a
87 a
88 l
89 a
90 d
91 o
92 *
93 l
94 a
95 b
96 *
97 b
98 r
99 a
100 g
101 e
102 t	
103 a
104 *
105 c
106 *
107 i
108 b
109 i
110 s
111 o
112 b
113 s
114 *
115 f
116 e
117 d
118 *
119 y
120 a
121 p
}


array set ID {

1 .top0.f1.f1.e1
2 .top0.f1.f2.e1
3 .top0.f1.f3.e1
4 .top0.f1.f4.e1
5 .top0.f1.f5.e1
6 .top0.f1.f6.e1
7 .top0.f1.f7.e1
8 .top0.f1.f8.e1
9  .top0.f1.f9.e1
10 .top0.f1.f10.e1
11 .top0.f1.f11.e1
12 .top0.f1.f1.e2
13 .top0.f1.f2.e2
14 .top0.f1.f3.e2
15 .top0.f1.f4.e2
16 .top0.f1.f5.e2
17 .top0.f1.f6.e2
18 .top0.f1.f7.e2
19 .top0.f1.f8.e2
20 .top0.f1.f9.e2
21 .top0.f1.f10.e2
22 .top0.f1.f11.e2
23 .top0.f1.f1.e3
24 .top0.f1.f2.e3
25 .top0.f1.f3.e3
26 .top0.f1.f4.e3
27 .top0.f1.f5.e3
28 .top0.f1.f6.e3
29 .top0.f1.f7.e3
30 .top0.f1.f8.e3
31 .top0.f1.f9.e3
32 .top0.f1.f10.e3
33 .top0.f1.f11.e3
34 .top0.f1.f1.e4
35 .top0.f1.f2.e4
36 .top0.f1.f3.e4
37 .top0.f1.f4.e4
38 .top0.f1.f5.e4
39 .top0.f1.f6.e4
40 .top0.f1.f7.e4
41 .top0.f1.f8.e4
42 .top0.f1.f9.e4
43 .top0.f1.f10.e4
44 .top0.f1.f11.e4
45 .top0.f1.f1.e5
46 .top0.f1.f2.e5
47 .top0.f1.f3.e5
48 .top0.f1.f4.e5
49 .top0.f1.f5.e5
50 .top0.f1.f6.e5
51 .top0.f1.f7.e5
52 .top0.f1.f8.e5
53 .top0.f1.f9.e5
54 .top0.f1.f10.e5
55 .top0.f1.f11.e5
56 .top0.f1.f1.e6
57 .top0.f1.f2.e6
58 .top0.f1.f3.e6
59 .top0.f1.f4.e6
60 .top0.f1.f5.e6
61 .top0.f1.f6.e6
62 .top0.f1.f7.e6
63 .top0.f1.f8.e6
64 .top0.f1.f9.e6
65 .top0.f1.f10.e6
66 .top0.f1.f11.e6
67 .top0.f1.f1.e7
68 .top0.f1.f2.e7
69 .top0.f1.f3.e7
70 .top0.f1.f4.e7
71 .top0.f1.f5.e7
72 .top0.f1.f6.e7
73 .top0.f1.f7.e7
74 .top0.f1.f8.e7
75 .top0.f1.f9.e7
76 .top0.f1.f10.e7
77 .top0.f1.f11.e7
78 .top0.f1.f1.e8
79 .top0.f1.f2.e8
80 .top0.f1.f3.e8
81 .top0.f1.f4.e8
82 .top0.f1.f5.e8
83 .top0.f1.f6.e8
84 .top0.f1.f7.e8
85 .top0.f1.f8.e8
86 .top0.f1.f9.e8
87 .top0.f1.f10.e8
88 .top0.f1.f11.e8
89 .top0.f1.f1.e9
90 .top0.f1.f2.e9
91 .top0.f1.f3.e9
92 .top0.f1.f4.e9
93 .top0.f1.f5.e9
94 .top0.f1.f6.e9
95 .top0.f1.f7.e9
96 .top0.f1.f8.e9
97 .top0.f1.f9.e9
98 .top0.f1.f10.e9
99 .top0.f1.f11.e9
100 .top0.f1.f1.e10
101 .top0.f1.f2.e10
102 .top0.f1.f3.e10
103 .top0.f1.f4.e10
104 .top0.f1.f5.e10
105 .top0.f1.f6.e10
106 .top0.f1.f7.e10
107 .top0.f1.f8.e10
108 .top0.f1.f9.e10
109 .top0.f1.f10.e10
110 .top0.f1.f11.e10
111 .top0.f1.f1.e11
112 .top0.f1.f2.e11
113 .top0.f1.f3.e11
114 .top0.f1.f4.e11
115 .top0.f1.f5.e11
116 .top0.f1.f6.e11
117 .top0.f1.f7.e11
118 .top0.f1.f8.e11
119 .top0.f1.f9.e11
120 .top0.f1.f10.e11
121 .top0.f1.f11.e11
}

#-------- widget bindings ------------

bind all  {tkEntryBackspace %W}
bind all  {
		if [%W selection present] {
			%W delete sel.first sel.last
		} else {
			%W delete insert
		}
	}
bind all  {empty_all}


#----------
set Name $Parent.l1
label $Name     -relief sunken -width 30 -background white \
    -text Clue  
pack $Name -anchor nw -side top -fill none

#------------------

set Name $Parent.f1
frame $Name -borderwidth 0 -background black
pack $Name -anchor nw -side top

#----------
set Name $Parent.f1.f1
frame $Name     -borderwidth 0 -background black \
    -relief sunken 
 pack $Name -anchor nw -side left
#
#----------
set Name $Parent.f1.f1.e1
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top


binds 1 3 1 {$clue(h1)} 5 1 {$clue(v1)}


#----------
set Name $Parent.f1.f1.e2
entry $Name    -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top



binds 12 4 1 {$clue(h9)} 5 2 {$clue(v1)}



#--------
set Name $Parent.f1.f1.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top

binds  23 3 1 {$clue(h11)} 5 3 {$clue(v1)}


#----------
set Name $Parent.f1.f1.e4
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top


binds  34 4 1 {$clue(h15)} 5 4 {$clue(v1)}

#----------
set Name $Parent.f1.f1.e5
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top

binds 45 1 1 {$clue(h0)} 5 5 {$clue(v1)}

#----------
set Name $Parent.f1.f1.e6
entry $Name   -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
     -side top


binds  56 1 1 {$clue(h0)} 1 1 {$clue(h0)}

#----------
set Name $Parent.f1.f1.e7
entry $Name   -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
     -side top


binds 67 3 1 {$clue(h24)} 1 1 {$clue(h0)}

#
#----------
set Name $Parent.f1.f1.e8
entry $Name   -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
     -side top



binds 78 1 1 {$clue(h0)} 1 1 {$clue(h0)}


#
#----------
set Name $Parent.f1.f1.e9
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
   -fill none \
    -side top

binds 89 3 1 {$clue(h33)} 3 1 {$clue(v33)}


#----------
set Name $Parent.f1.f1.e10
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top


binds 100 4 1 {$clue(h36)} 3 2 {$clue(v33)} 


#----------
set Name $Parent.f1.f1.e11
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top

binds 111 3 1 {$clue(h38)} 3 3 {$clue(v33)}	   

#
#----------
set Name $Parent.f1.f2
frame $Name     -borderwidth 0 -background black \
      -relief sunken 

pack $Name -side left -anchor nw
#
#----------
set Name $Parent.f1.f2.e1
entry $Name    -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
     -side top

binds 2 3 2 {$clue(h1)} 4 1 {$clue(v2)}

#
#----------
set Name $Parent.f1.f2.e2
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
      -side top

binds 13 4 2 {$clue(h9)} 4 2 {$clue(v2)}  

#
#----------
set Name $Parent.f1.f2.e3
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 24 3 2 {$clue(h11)} 4 3 {$clue(v2)} 


#----------
set Name $Parent.f1.f2.e4
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 35 4 2 {$clue(h15)} 4 4 {$clue(v2)}  

#
#----------
set Name $Parent.f1.f2.e5
entry $Name   -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 46 1 1 {$clue(h0)} 1 1 {$clue(v0)}

#
#----------
set Name $Parent.f1.f2.e6
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 57 1 1 {$clue(h0)} 6 1 {$clue(v21)} 

#
#
#----------
set Name $Parent.f1.f2.e7
entry $Name   -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 68 3 2 {$clue(h24)} 6 2 {$clue(v21)}


#
#
#----------
set Name $Parent.f1.f2.e8
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 79 5 1 {$clue(h29)} 6 3 {$clue(v21)}  

#
#----------
set Name $Parent.f1.f2.e9
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 90 3 2 {$clue(h33)} 6 4 {$clue(v21)}  

#----------
set Name $Parent.f1.f2.e10
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 101 4 2 {$clue(h36)} 6 5 {$clue(v21)}  


#----------
set Name $Parent.f1.f2.e11
entry $Name   -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 112 3 2 {$clue(h38)} 6 6 {$clue(v21)}  


#
#
#----------
set Name $Parent.f1.f3
frame $Name     -borderwidth 0 -background black \
    -relief sunken

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f3.e1
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 3 3 3 {$clue(h1)} 5 1 {$clue(v3)}  


#----------
set Name $Parent.f1.f3.e2
entry $Name      -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 14 4 3 {$clue(h9)} 5 2 {$clue(v3)}  

#
#----------
set Name $Parent.f1.f3.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 25 3 3 {$clue(h11)} 5 3 {$clue(v3)}  


#
#----------
set Name $Parent.f1.f3.e4
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 36 4 3 {$clue(h15)} 5 4 {$clue(v3)}  

#
#----------
set Name $Parent.f1.f3.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 47 3 1 {$clue(h18)} 5 5 {$clue(v3)} 


#----------
set Name $Parent.f1.f3.e6
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 58 1 1 {$clue(h0)} 1 1 {$clue(h0)} 


#----------
set Name $Parent.f1.f3.e7
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 69 3 3 {$clue(h24)} 5 1 {$clue(v25)} 

#----------
set Name $Parent.f1.f3.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds  80 5 2 {$clue(h29)} 5 2 {$clue(v25)}  

#----------
set Name $Parent.f1.f3.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 91 3 3 {$clue(h33)} 5 3 {$clue(v25)}  

#----------
set Name $Parent.f1.f3.e10 
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 102 4 3 {$clue(h36)} 5 4 {$clue(v25)}
  

#----------

set Name $Parent.f1.f3.e11
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 113 3 3 {$clue(h38)} 5 5 {$clue(v25)}  


#----------
set Name $Parent.f1.f4
frame $Name     -borderwidth 0 -background black \
    -relief sunken 

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f4.e1
entry $Name     -width 2 -background black -foreground black -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 4 1 1 {$clue(h0)} 1 1 {$clue(v0)}  

#
#----------
set Name $Parent.f1.f4.e2
entry $Name      -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 15 4 4 {$clue(h9)} 1 1 {$clue(v0)}  

#
#----------
set Name $Parent.f1.f4.e3
entry $Name     -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 26 1 1 {$clue(h0)} 1 1 {$clue(h0)}  

#
#----------
set Name $Parent.f1.f4.e4
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 37 4 4 {$clue(h15)} 3 1 {$clue(v16)}  


#
#----------
set Name $Parent.f1.f4.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 48 3 2 {$clue(h18)} 3 2 {$clue(v16)}


#----------

set Name $Parent.f1.f4.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 59 5 1 {$clue(h22)} 3 3 {$clue(v16)}  



#----------

set Name $Parent.f1.f4.e7
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 70 1 1 {$clue(h9)} 1 1 {$clue(h0)}  

#----------

set Name $Parent.f1.f4.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 81 5 3 {$clue(h29)} 1 1 {$clue(h0)}  



#----------

set Name $Parent.f1.f4.e9
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 92 1 1 {$clue(h0)} 1 1 {$clue(h0)}

#----------

set Name $Parent.f1.f4.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 103 4 4 {$clue(h36)} 1 1 {$clue(h0)}  


#----------

set Name $Parent.f1.f4.e11
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 114 1 1 {$clue(h0)} 1 1 {$clue(h0)}

#----------
set Name $Parent.f1.f5
frame $Name     -borderwidth 0 -background black \
    -relief sunken 

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f5.e1
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 5 3 1 {$clue(h4)} 1 1 {$clue(h0)}  

#
#----------
set Name $Parent.f1.f5.e2
entry $Name      -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 16 1 1 {$clue(h0)} 1 1 {$clue(h0)} 
#----------
set Name $Parent.f1.f5.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 27 3 1 {$clue(h12)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f5.e4
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 38 1 1 {$clue(h0)} 1 1 {$clue(v0)}  


#----------
set Name $Parent.f1.f5.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 49 3 3 {$clue(h18)} 5 1 {$clue(v19)}  


#----------
set Name $Parent.f1.f5.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 60 5 2 {$clue(h22)} 5 2 {$clue(v19)}  


#----------
set Name $Parent.f1.f5.e7
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top



binds 71 1 1 {$clue(h0)} 5 3 {$clue(v19)} 


#----------
set Name $Parent.f1.f5.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 82 5 4 {$clue(h29)} 5 4 {$clue(v19)}  


#----------
set Name $Parent.f1.f5.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 93 3 1 {$clue(h34)} 5 5 {$clue(v19)}  

#----------
set Name $Parent.f1.f5.e10
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 104 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f5.e11
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 115 3 1 {$clue(h39)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f6
frame $Name     -borderwidth 0 -background black \
    -relief sunken 

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f6.e1
entry $Name     -width 2 -background white -foreground black -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 6 3 2 {$clue(h4)} 4 1 {$clue(v5)}

#
#----------
set Name $Parent.f1.f6.e2
entry $Name      -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 17 1 1 {$clue(h0)} 4 2 {$clue(v5)}  

#
#----------
set Name $Parent.f1.f6.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 28 3 2 {$clue(h12)} 4 3 {$clue(v5)}  


#
#----------
set Name $Parent.f1.f6.e4
entry $Name   -width 2 -background white -foreground black  -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 39 5 1 {$clue(h17)} 4 4 {$clue(v5)}  


#----------
set Name $Parent.f1.f6.e5
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 50 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f6.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 61 5 3 {$clue(h22)} 1 1 {$clue(v0)}

#----------
set Name $Parent.f1.f6.e7
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 72 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f6.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 83 5 5 {$clue(h29)} 4 1 {$clue(v30)} 

#----------
set Name $Parent.f1.f6.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 94 3 2 {$clue(h34)} 4 2 {$clue(v30)}  


#----------
set Name $Parent.f1.f6.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 105 1 1 {$clue(h0)} 4 3 {$clue(v30)} 


#----------
set Name $Parent.f1.f6.e11
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 116 3 2 {$clue(h39)} 4 4 {$clue(v30)} 

#----------


#----------
set Name $Parent.f1.f7
frame $Name     -borderwidth 0 -background black \
    -relief sunken

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f7.e1
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 7 3 3 {$clue(h4)} 1 1 {$clue(v0)} 


#
#----------
set Name $Parent.f1.f7.e2
entry $Name      -width 2 -background black -foreground black -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 18 1 1 {$clue(h0)} 1 1 {$clue(v0)}  

#
#----------
set Name $Parent.f1.f7.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 29 3 3 {$clue(h12)} 5 1 {$clue(v13)}  


#
#----------
set Name $Parent.f1.f7.e4 
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 40 5 2 {$clue(h17)} 5 2 {$clue(v13)}  

#----------
set Name $Parent.f1.f7.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 51 1 1 {$clue(h0)} 5 3 {$clue(v13)}  

#----------
set Name $Parent.f1.f7.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 62 5 4 {$clue(h22)} 5 4 {$clue(v13)} 

#----------
set Name $Parent.f1.f7.e7
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 73 3 1 {$clue(h26)} 5 5 {$clue(v13)}  

#----------
set Name $Parent.f1.f7.e8
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 84 1 1 {$clue(h0)} 1 1 {$clue(v0)}  


#----------
set Name $Parent.f1.f7.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 95 3 3 {$clue(h34)} 1 1 {$clue(v0)}  


#----------

set Name $Parent.f1.f7.e10
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 106 1 1 {$clue(h0)} 1 1 {$clue(v0)}  


#----------

set Name $Parent.f1.f7.e11
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 117 3 3 {$clue(h39)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f8
frame $Name     -borderwidth 0 -background black \
    -relief sunken 

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f8.e1
entry $Name     -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 8 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#
#----------
set Name $Parent.f1.f8.e2
entry $Name      -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 19 4 1 {$clue(h10)} 1 1 {$clue(v0)}  

#
#----------
set Name $Parent.f1.f8.e3
entry $Name     -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 30 1 1 {$clue(h0)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f8.e4
entry $Name   -width 2 -background white -foreground black   -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 41 5 3 {$clue(h17)} 1 1 {$clue(v0)}  


#----------
set Name $Parent.f1.f8.e5
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 52 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f8.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 63 5 5 {$clue(h22)} 3 1 {$clue(v23)} 


#----------
set Name $Parent.f1.f8.e7
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 74 3 2 {$clue(h26)} 3 2 {$clue(v23)}

#----------
set Name $Parent.f1.f8.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 85 4 1 {$clue(h31)} 3 3 {$clue(v23)}  

#----------
set Name $Parent.f1.f8.e9
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 96 1 1 {$clue(h0)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f8.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 107 4 1 {$clue(h37)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f8.e11
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 118 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f9
frame $Name     -borderwidth 0 -background black \
    -relief sunken

pack $Name -anchor nw -side left
#
#----------
set Name $Parent.f1.f9.e1
entry $Name     -width 2 -background white -foreground black -relief sunken  
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 9 3 1 {$clue(h6)} 5 1 {$clue(v6)}  

#
#----------
set Name $Parent.f1.f9.e2
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 20 4 2 {$clue(h10)} 5 2 {$clue(v6)}  

#
#----------
set Name $Parent.f1.f9.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 31 3 1 {$clue(h14)} 5 3 {$clue(v6)}  

#
#----------
set Name $Parent.f1.f9.e4
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 42 5 4 {$clue(h17)} 5 4 {$clue(v6)}  
 
# ----------
set Name $Parent.f1.f9.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 53 3 1 {$clue(h20)} 5 5 {$clue(v6)}  


#----------
set Name $Parent.f1.f9.e6
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 64 1 1 {$clue(h0)} 1 1 {$clue(v0)} 


#----------
set Name $Parent.f1.f9.e7
entry $Name   -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 75 3 3 {$clue(h26)} 5 1 {$clue(v27)}  


#----------
set Name $Parent.f1.f9.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 86 4 2 {$clue(h31)} 5 2 {$clue(v27)} 

#----------
set Name $Parent.f1.f9.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 97 3 1 {$clue(h35)} 5 3 {$clue(v27)}  

#----------
set Name $Parent.f1.f9.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 108 4 2 {$clue(h37)} 5 4 {$clue(v27)}  

#----------
set Name $Parent.f1.f9.e11
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 119 3 1 {$clue(h40)} 5 5 {$clue(v27)}  


#----------
set Name $Parent.f1.f10
frame $Name     -borderwidth 0 -background black \
    -relief sunken

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f10.e1
entry $Name     -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 10 3 2 {$clue(h6)} 6 1 {$clue(v7)}  

#
#----------
set Name $Parent.f1.f10.e2
entry $Name      -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 21 4 3 {$clue(h10)} 6 2 {$clue(v7)}

#
#----------
set Name $Parent.f1.f10.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 32 3 2 {$clue(h14)} 6 3 {$clue(v7)}  

#
#----------
set Name $Parent.f1.f10.e4
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 43 5 5 {$clue(h17)} 6 4 {$clue(v7)}
  
#----------
set Name $Parent.f1.f10.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 54 3 2 {$clue(h20)} 6 5 {$clue(v7)}  

#----------
set Name $Parent.f1.f10.e6
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 65 1 1 {$clue(h0)} 6 6 {$clue(v7)}  

#----------
set Name $Parent.f1.f10.e7
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top
binds 76 1 1 {$clue(h0)} 1 1 {$clue(v0)}  

#----------
set Name $Parent.f1.f10.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 87 4 3 {$clue(h31)} 4 1 {$clue(v32)}  

#----------
set Name $Parent.f1.f10.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 98 3 2 {$clue(h35)} 4 2 {$clue(v32)}  


#----------
set Name $Parent.f1.f10.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 109 4 3 {$clue(h37)} 4 3 {$clue(v32)}  

#----------
set Name $Parent.f1.f10.e11
entry $Name   -width 2 -background white -foreground black -relief sunken -state normal
pack $Name     -anchor nw \
    -fill none \
    -side top

 
binds 120 3 2 {$clue(h40)} 4 4 {$clue(v32)}  

#----------
set Name $Parent.f1.f11
frame $Name     -borderwidth 0 -background black \
    -relief sunken 

pack $Name -anchor nw -side left 
#
#----------
set Name $Parent.f1.f11.e1
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 11 3 3 {$clue(h6)} 3 1 {$clue(v8)}  

#
#----------
set Name $Parent.f1.f11.e2
entry $Name      -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 22 4 4 {$clue(h10)} 3 2 {$clue(v8)}  

#
#----------
set Name $Parent.f1.f11.e3
entry $Name     -width 2 -background white -foreground black -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 33 3 3 {$clue(h14)} 3 3 {$clue(v8)} 


#
#----------
set Name $Parent.f1.f11.e4
entry $Name   -width 2 -background black -foreground black   -relief sunken -state disabled
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 44 1 1 {$clue(h0)} 1 1 {$clue(v0)} 

#----------
set Name $Parent.f1.f11.e5
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 55 3 3 {$clue(h20)} 1 1 {$clue(v0)}

#----------
set Name $Parent.f1.f11.e6
entry $Name   -width 2 -background black -foreground black -relief sunken -state disabled 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 66 1 1 {$clue(h0)} 1 1 {$clue(v0)} 


#----------
set Name $Parent.f1.f11.e7
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 77 1 1 {$clue(h0)} 5 1 {$clue(v28)} 

#----------
set Name $Parent.f1.f11.e8
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 88 4 4 {$clue(h31)} 5 2 {$clue(v28)}  
#----------
set Name $Parent.f1.f11.e9
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 99 3 3 {$clue(h35)} 5 3 {$clue(v28)}  

#----------
set Name $Parent.f1.f11.e10
entry $Name   -width 2 -background white -foreground black   -relief sunken 
pack $Name     -anchor nw \
    -fill none \
    -side top

binds 110 4 4 {$clue(h37)} 5 4 {$clue(v28)} 

#----------
set Name $Parent.f1.f11.e11
entry $Name   -width 2 -background white -foreground black -relief sunken -state normal 
pack $Name     -anchor nw \
    -fill none \
    -side top


binds 121 3 3 {$clue(h40)} 5 5 {$clue(v28)}  


# -----------------
set Name $Parent.b1
button $Name -width 10 -background white -foreground black -text "Check All" -command {check_letters}
pack $Name -anchor nw -side top -fill none





#------< End of File >-----