summaryrefslogtreecommitdiffstats
path: root/library/demos/puzzle.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-06-14 10:56:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-06-14 10:56:58 (GMT)
commitcfa85ce7321d315e312a7bb23d4cdf0b2d666f47 (patch)
treeab207a698a3ec34347d9ed68baa80cb2825a3bd1 /library/demos/puzzle.tcl
parent019ad61b8b1833368240e189ad1b47b00feaab4c (diff)
downloadtk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.zip
tk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.tar.gz
tk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.tar.bz2
Added braces to expressions.
Diffstat (limited to 'library/demos/puzzle.tcl')
-rw-r--r--library/demos/puzzle.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl
index e3ee8cc..b0fa685 100644
--- a/library/demos/puzzle.tcl
+++ b/library/demos/puzzle.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a 15-puzzle game using a collection
# of buttons.
#
-# RCS: @(#) $Id: puzzle.tcl,v 1.2 1998/09/14 18:23:29 stanton Exp $
+# RCS: @(#) $Id: puzzle.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -60,10 +60,10 @@ pack $w.frame -side top -pady 1c -padx 1c
destroy $w.s
set order {3 1 6 2 5 7 15 13 4 11 8 9 14 10 12}
-for {set i 0} {$i < 15} {set i [expr $i+1]} {
+for {set i 0} {$i < 15} {set i [expr {$i+1}]} {
set num [lindex $order $i]
- set xpos($num) [expr ($i%4)*.25]
- set ypos($num) [expr ($i/4)*.25]
+ set xpos($num) [expr {($i%4)*.25}]
+ set ypos($num) [expr {($i/4)*.25}]
button $w.frame.$num -relief raised -text $num -highlightthickness 0 \
-command "puzzleSwitch $w $num"
place $w.frame.$num -relx $xpos($num) -rely $ypos($num) \