Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Dot+to+Dots?V=11
QUERY_STRINGV=11
CONTENT_TYPE
DOCUMENT_URI/revision/Dot+to+Dots
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.71.254.93
REMOTE_PORT12620
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.149.229.253
HTTP_CF_RAY876f956a2a2e231c-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.149.229.253
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: TR -> PRE

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: TR -> PRE} {}} CALL {my render_wikit {Dot to Dots} \[Keith\ Vetter\]\ 2002-10-21\ -\ I\ threw\ together\ a\ quick\ little\ dot-to-dot\ game.\ I\ designed\ it\ for\ my\ 3-year\ old\ daughter,\ so\ it's\ intended\ to\ be\ easy\ to\ use:\ the\ target\ next\ dot\ gets\ enlarged\ and\ highlighted,\ you\ don't\ drag\ &\ drop\ but\ just\ click,\ a\ line\ is\ drawn\ from\ the\ last\ dot\ to\ the\ mouse,\ etc.\n\n\n''\[KPV\]''\ 2003-02-28\ --\ I've\ put\ up\ an\ updated\ version\ of\ \n''Dot\ to\ Dots''.\ This\ version\ includes\ more\ puzzles,\ a\ revamped\ GUI,\ better\ build\ mode\nand\ sound\ effects\ (only\ if\ you\ have\ the\ base64\ and\ snack\ packages).\ \n\n''\[escargo\]''\ --\ When\ I\ used\ wish-reaper\ to\ download\ this\ and\ tried\ to\ run\ it\ on\ my\nWindows\ XP\ box\ with\ \[ActiveTcl\]\ 8.4.1\ I\ got\ this\ message:\n''illegal\ character\ found\ in\ input\ while\ executing...''\n\n''\[KPV\]''\ -\ investigation\ revealed\ that\ this\ is\ a\ bug\ in\ \[tcllib\]'s\ \[base64\]\npackage--it\ barfing\ on\ leading\ spaces.\ (Actually\ the\ bug\ is\ in\ \[Trf\]\ which\ gets\nused\ for\ speed\ up,\ the\ tcl-only\ version\ works\ correctly.\ ActiveTcl\ version\ 4.1a\ \nand\ 4.1.0\ didn't\ include\ Trf\ while\ 4.1.1\ does.)\ \nRFC2045,\ which\ defines\ base64,\ specifically\ says\ that\ all\ncharacters\ outside\ the\ base64\ alphabet\ should\ be\ ignored.\ Anyway,\ I\ fixed\ it\ by\ncleaning\ up\ the\ data\ before\ passing\ it\ to\ the\ base64\ decoder.\n\n''\[escargo\]''\ --\ I\ reaped\ the\ newer\ version\ and\ found\ that\ it\ behaves\ correctly.\nWould\ it\ make\ sense\ to\ do\ your\ own\ volume\ control?\ \ Or\ is\ that\ something\ more\ appropriate\nto\ leave\ to\ external\ sound\ processing?\n\n''\[Sandy\]''\ --\ I've\ put\ a\ 'diff'\ here\ (save\ and\ use\ \"patch\ <dot2dot.patch\"\ to\ apply)\ that\ improves\ the\ color\nchanges\ (color\ change\ changes\ item\ base\ color,\ e.g.\ red\ or\ green\ apple),\ and\ automatically\ saves\ new\ dot2dots\nmade\ in\ the\ Build\ function\ into\ a\ \".dots\"\ directory\ if\ (and\ only\ if)\ that\ directory\ exists\ and\ has\ a\ file\nnamed\ \"count\"\ in\ it,\ that\ gives\ the\ highest\ existing\ filename\ (e.g.\ dot.9\ if\ you\ save\ each\ individual\ dot\nspec\ into\ its\ own\ file).\ \ I\ seperated\ out\ each\ dot\ into\ its\ own\ file\ and\ put\ them\ there,\ to\ seed\ it,\ and\nnow\ it's\ easy\ to\ draw\ (using\ dot2dot.tcl)\ new\ drawings\ for\ the\ kiddies.\ \ It's\ somewhat\ unsafe\ in\ that\ the\nsave\ files\ get\ sourced,\ and\ thus\ could\ contain\ any\ tcl\ code,\ but\ it\ pleases\ the\ kids\ in\ my\ internal\ machine.\nQueries\ etc\ to\ [email protected],\ this\ being\ my\ first\ post\ to\ this\ wiki.\ I\ did\ it\ as\ a\ patch\ so\ people\ don't\ have\nto\ accept\ the\ changes,\ but\ feel\ free\ to\ just\ check\ it\ in\ (or\ make\ me\ check\ it\ in)\ over\ the\ original\ if\ desired.\n\n----\n\ ##+##########################################################################\n\ #\n\ #\ dot2dot.tcl\ -\ a\ simple\ dot-to-dot\ game\n\ #\ by\ Keith\ Vetter\n\ #\n\ #\ Revisions:\n\ #\ KPV\ Oct\ 20,\ 2002\ -\ initial\ revision\n\ #\ KPV\ Feb\ 28,\ 2003\ -\ added\ more\ puzzles,\ revamped\ gui,\ added\ sounds\n\ #\n\ \n\ package\ require\ Tk\n\ \n\ set\ S(r1)\ 5\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Dot\ size\n\ set\ S(r2)\ 10\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Dot\ size\ when\ it's\ next\n\ set\ S(build)\ 0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Build\ mode\n\ set\ S(which)\ -1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Which\ puzzle\ we're\ doing\n\ set\ S(out)\ 1\n\ set\ S(color)\ black\n\ set\ S(sound)\ 1\n\ set\ ddata(done)\ 0\n\ set\ xdots\ \{\}\n\ \n\ proc\ DoDisplay\ \{\}\ \{\n\ \ \ \ wm\ title\ .\ \"Dot\ 2\ Dot\"\n\ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\ -padx\ 5\ -pady\ 5\]\ \\\n\ \ \ \ \ \ \ \ -side\ right\ -fill\ both\ -ipady\ 5\n\ \ \ \ pack\ \[frame\ .top\ -relief\ raised\ -bd\ 2\]\ -side\ top\ -fill\ x\n\ \ \ \ pack\ \[frame\ .screen\ -bd\ 2\ -relief\ raised\]\ -side\ top\ -fill\ both\ -expand\ 1\n\ \ \ \ \n\ \ \ \ canvas\ .c\ -relief\ raised\ -borderwidth\ 0\ -height\ 600\ -width\ 700\ \\\n\ \ \ \ \ \ \ \ -highlightthickness\ 0\n\ \ \ \ .c\ xview\ moveto\ 0\ \;\ .c\ yview\ moveto\ 0\n\ \ \ \ pack\ .c\ -in\ .screen\ -side\ top\ -fill\ both\ -expand\ 1\n\ \n\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n\ \ \ \ lappend\ colors\ \[lindex\ \[.c\ config\ -bg\]\ 3\]\ black\n\ \ \ \ foreach\ color\ \$colors\ \{\n\ \ \ \ \ \ \ \ radiobutton\ .top.b\$color\ -width\ 1\ -padx\ 0\ -pady\ 0\ -bg\ \$color\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -variable\ S(color)\ -value\ \$color\ -command\ ReColor\n\ \ \ \ \ \ \ \ bind\ .top.b\$color\ <3>\ \[list\ .c\ config\ -bg\ \$color\]\n\ \ \ \ \}\n\ \ \ \ eval\ pack\ \[winfo\ children\ .top\]\ -side\ left\ -fill\ y\n\ \ \ \ \n\ \ \ \ focus\ .c\n\ \ \ \ pack\ .c\ -side\ left\ -fill\ both\ -expand\ 1\n\ \ \ \ bind\ .c\ <Motion>\ \[list\ MMove\ %x\ %y\]\n\ \ \ \ bind\ .c\ <Button-1>\ \{MDown\ %x\ %y\}\n\ \ \ \ bind\ .c\ <Button-3>\ \{M3Down\ %x\ %y\}\n\ \ \ \ bind\ .c\ <Leave>\ \{.c\ delete\ xline\}\n\ \ \ \ bind\ .c\ <Configure>\ \{ReCenter\ %W\ %h\ %w\}\n\ \ \ \ bind\ .c\ <Control-s>\ \{ConnectDot\ 1\}\n\ \ \ \ bind\ .c\ <Control-a>\ ConnectDot\n\ \ \ \ bind\ all\ <Alt-c>\ \{console\ show\}\n\ \n\ \ \ \ DoCtrlFrame\n\ \ \ \ return\n\ \}\n\ proc\ DoCtrlFrame\ \{\}\ \{\n\ \n\ \ \ \ option\ add\ *Button.borderWidth\ 4\ \n\ \ \ \ button\ .restart\ -text\ Restart\ -command\ \{DoDots\ -2\}\n\ \ \ \ button\ .next\ -text\ \"Next\ Puzzle\"\ -command\ \{DoDots\ -1\}\n\ \ \ \ button\ .random\ -text\ \"Random\ Puzzle\"\ -command\ \{DoDots\ -3\}\n\ \ \ \ frame\ .pf\ -bd\ \[.next\ cget\ -bd\]\ -relief\ raised\n\ \ \ \ label\ .pl\ -text\ \"\ Pick\ Puzzle\"\n\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \ \ \ \n\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\ -padx\ 5\ \n\ \ \ \ checkbutton\ .build\ -text\ \"Build\ Mode\"\ -variable\ S(build)\ -anchor\ w\ \\\n\ \ \ \ \ \ \ \ -command\ ToggleBuildMode\n\ \ \ \ button\ .done\ -text\ Done\ -command\ Done\n\ \ \ \ button\ .clear\ -text\ Clear\ -command\ Clear\n\ \ \ \ button\ .copy\ -text\ Copy\ -command\ Copy\n\ \ \ \ button\ .undo\ -text\ Undo\ -command\ \{M3Down\ -1\ -1\}\n\ \n\ \ \ \ checkbutton\ .sound\ -text\ \"Sounds\"\ -relief\ raised\ -bd\ \[.next\ cget\ -bd\]\ \\\n\ \ \ \ \ \ \ \ -variable\ S(sound)\ -padx\ 10\ -anchor\ w\n\ \ \ \ button\ .about\ -text\ About\ -command\ About\n\ \n\ \ \ \ grid\ .pf\ \ \ \ -in\ .ctrl\ -sticky\ ew\ -row\ 0\n\ \ \ \ pack\ .pl\ .p\ -in\ .pf\ -side\ left\n\ \ \ \ \n\ \ \ \ grid\ .next\ \ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .random\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .restart\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .bframe\ -in\ .ctrl\ -sticky\ ew\ -row\ 11\n\ \ \ \ grid\ .sound\ -in\ .ctrl\ -sticky\ ew\ -row\ 51\n\ \ \ \ grid\ .about\ -in\ .ctrl\ -sticky\ ew\n\ \n\ \ \ \ place\ .build\ -in\ .bframe\ -relx\ .05\ -rely\ 0\ -anchor\ w\n\ \ \ \ grid\ .clear\ \ -in\ .bframe\ -sticky\ ew\ -row\ 2\n\ \ \ \ grid\ .copy\ \ \ -in\ .bframe\ -sticky\ ew\n\ \ \ \ grid\ .undo\ \ \ -in\ .bframe\ -sticky\ ew\n\ \ \ \ grid\ .done\ \ \ -in\ .bframe\ -sticky\ ew\n\ \n\ \ \ \ grid\ rowconfigure\ .ctrl\ 10\ -minsize\ 50\n\ \ \ \ grid\ rowconfigure\ .ctrl\ 50\ -weight\ 1\n\ \ \ \ grid\ rowconfigure\ .bframe\ 0\ -minsize\ 20\n\ \ \ \ grid\ rowconfigure\ .bframe\ 10\ -minsize\ 5\n\ \ \ \ grid\ columnconfigure\ .bframe\ 0\ -weight\ 1\n\ \n\ \ \ \ trace\ variable\ ::S(new)\ w\ PickPuzzle\n\ \ \ \ trace\ variable\ ::S(build)\ w\ TraceBuild\n\ \ \ \ trace\ variable\ ::xdots\ w\ TraceXDots\n\ \}\n\ proc\ ReColor\ \{\}\ \{\n\ \ \ \ global\ S\n\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n\ \ \ \ .c\ itemconfig\ dot\ -fill\ \$S(color)\ -outline\ \$S(color)\n\ \ \ \ .c\ itemconfig\ extra\ -fill\ \$S(color)\n\ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ \$S(color)\}\n\ \}\n\ proc\ TraceBuild\ \{var1\ var2\ op\}\ \{\n\ \ \ \ if\ \{\$::S(build)\}\ \{set\ s\ normal\}\ \{set\ s\ disabled\}\n\ \ \ \ foreach\ w\ \{.copy\ .undo\ .done\ .clear\}\ \{\n\ \ \ \ \ \ \ \ \$w\ config\ -state\ \$s\n\ \ \ \ \}\n\ \ \ \ TraceXDots\ x\ y\ z\n\ \}\n\ proc\ TraceXDots\ \{var1\ var2\ op\}\ \{\n\ \ \ \ if\ \{!\ \$::S(build)\}\ return\n\ \ \ \ set\ len\ \[llength\ \$::xdots\]\n\ \ \ \ array\ set\ s\ \{0\ disabled\ 1\ normal\}\n\ \ \ \ .undo\ config\ -state\ \$s(\[expr\ \{\$len\ >\ 0\}\])\n\ \ \ \ .done\ config\ -state\ \$s(\[expr\ \{\$len\ >=\ 6\}\])\n\ \}\n\ proc\ PickPuzzle\ \{arr\ val\ op\}\ \{\n\ \ \ \ global\ S\n\ \ \ \ if\ \{\$S(new)\ ==\ \$S(which)\}\ return\n\ \ \ \ DoDots\ \$S(new)\n\ \}\n\ proc\ ReCenter\ \{W\ h\ w\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ by\ <Configure>\ event\n\ \ \ \ set\ h\ \[expr\ \{\$h\ /\ 2.0\}\]\n\ \ \ \ set\ w\ \[expr\ \{\$w\ /\ 2.0\}\]\n\ \ \ \ \$W\ config\ -scrollregion\ \[list\ -\$w\ -\$h\ \$w\ \$h\]\n\ \}\n\ proc\ About\ \{\}\ \{\n\ \ \ \ tk_messageBox\ -title\ About\ -message\ \\\n\ \ \ \ \ \ \ \ \"Dot\ 2\ Dot\\nby\ Keith\ Vetter,\ February\ 2003\"\n\ \}\n\ proc\ DoDots\ \{which\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Install\ a\ new\ puzzle\n\ \ \ \ global\ dots\ ddata\ S\n\ \ \ \ \n\ \ \ \ if\ \{\$which\ ==\ -2\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Reuse\ last\ one\n\ \ \ \ \ \ \ \ set\ which\ \$S(which)\n\ \ \ \ \}\ elseif\ \{\$which\ ==\ -1\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Next\ one\n\ \ \ \ \ \ \ \ set\ names\ \[lsort\ -dictionary\ \[array\ names\ dots\]\]\n\ \ \ \ \ \ \ \ set\ n\ \[lsearch\ \$names\ \$S(which)\]\ \ \ \ \ \ \ \ \;#\ Find\ which\ one\ was\ last\n\ \ \ \ \ \ \ \ if\ \{\[incr\ n\]\ >=\ \[llength\ \$names\]\}\ \{set\ n\ 0\}\ \;#\ Wrap\n\ \ \ \ \ \ \ \ set\ which\ \[lindex\ \$names\ \$n\]\n\ \ \ \ \}\ elseif\ \{\$which\ ==\ -3\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Random\n\ \ \ \ \ \ \ \ set\ names\ \[array\ names\ dots\]\n\ \ \ \ \ \ \ \ set\ len\ \[llength\ \$names\]\n\ \ \ \ \ \ \ \ set\ n\ \[expr\ \{int(\$len\ *\ rand())\}\]\n\ \ \ \ \ \ \ \ set\ which\ \[lindex\ \$names\ \$n\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ set\ S(build)\ 0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Turn\ off\ build\ mode\n\ \ \ \ set\ S(which)\ \$which\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Remember\ which\ puzzle\n\ \ \ \ set\ S(new)\ \$which\n\ \ \ \ .c\ delete\ all\n\ \ \ \ catch\ \{unset\ ddata\}\n\ \ \ \ array\ set\ ddata\ \{done\ 0\ last\ 1\ next\ 2\ close\ 0\ xy\ \{\}\}\n\ \n\ \ \ \ set\ cnt\ 0\n\ \ \ \ foreach\ \{x\ y\}\ \$dots(\$which)\ \{\n\ \ \ \ \ \ \ \ if\ \{\$x\ ==\ 999\ &&\ \$y\ ==\ 999\}\ \{\ \ \ \ \ \ \ \ \ \ \ \;#\ Flag\ to\ connect\ to\ beginning\n\ \ \ \ \ \ \ \ \ \ \ \ set\ ddata(close)\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ break\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ incr\ cnt\n\ \ \ \ \ \ \ \ set\ ddata(\$cnt)\ \[list\ \$x\ \$y\]\n\ \ \ \ \ \ \ \ lappend\ ddata(xy)\ \$x\ \$y\n\ \ \ \ \ \ \ \ DrawOneDot\ \$cnt\n\ \ \ \ \}\n\ \ \ \ DoExtra\ \$which\n\ \ \ \ set\ ddata(end)\ \$cnt\n\ \ \ \ MakeTarget\n\ \}\n\ proc\ DrawOneDot\ \{n\}\ \{\n\ \ \ \ global\ ddata\ S\n\ \ \ \ foreach\ \{x\ y\}\ \$ddata(\$n)\ break\n\ \ \ \ set\ xy\ \[MakeBox\ \$x\ \$y\ \$S(r1)\]\n\ \ \ \ .c\ create\ oval\ \$xy\ -tag\ \[list\ dot\ d\$n\]\ -fill\ \$S(color)\ -outline\ \$S(color)\n\ \ \ \ set\ x\ \[expr\ \{\$x\ -\ 3\}\]\ \;\ set\ y\ \[expr\ \{\$y\ -\ 3\}\]\n\ \ \ \ .c\ create\ text\ \$x\ \$y\ -anchor\ se\ -text\ \$n\ -tag\ n\$n\n\ \ \ \ .c\ raise\ d\$n\ n\$n\n\ \}\n\ proc\ DoExtra\ \{which\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Draws\ extra\ lines\ on\ puzzle\n\ \ \ \ global\ extra\ ddata\n\ \n\ \ \ \ if\ \{!\ \[info\ exists\ extra(\$which)\]\}\ return\n\ \ \ \ set\ data\ \$extra(\$which)\n\ \ \ \ set\ len\ \[llength\ \$data\]\n\ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$len\}\ \{\}\ \{\n\ \ \ \ \ \ \ \ set\ what\ \[lindex\ \$data\ \$i\]\n\ \ \ \ \ \ \ \ set\ meta\ \[lindex\ \$data\ \[incr\ i\]\]\n\ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"c\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ foreach\ \{x\ y\}\ \[lrange\ \$data\ \$i\ \[expr\ \{\$i\ +\ 1\}\]\]\ break\n\ \ \ \ \ \ \ \ \ \ \ \ .c\ create\ oval\ \[MakeBox\ \$x\ \$y\ \$meta\]\ -width\ 5\ -tag\ extra\n\ \ \ \ \ \ \ \ \ \ \ \ incr\ i\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ continue\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"l\"\ ||\ \$what\ ==\ \"L\"\ ||\ \$what\ ==\ \"p\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"p\"\}\ \{set\ type\ polygon\}\ else\ \{set\ type\ line\}\n\ \ \ \ \ \ \ \ \ \ \ \ set\ last\ \[expr\ \{\$i\ +\ \$meta*2\ -\ 1\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ xy\ \[lrange\ \$data\ \$i\ \$last\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ n\ \[.c\ create\ \$type\ \$xy\ -width\ 3\ -tag\ extra\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ i\ \[expr\ \{\$last+1\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"L\"\}\ \{eval\ lappend\ ddata(xy)\ \$xy\}\n\ \ \ \ \ \ \ \ \ \ \ \ continue\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \}\n\ proc\ MakeBox\ \{x\ y\ d\}\ \{\n\ \ \ \ return\ \[list\ \[expr\ \{\$x-\$d\}\]\ \[expr\ \{\$y-\$d\}\]\ \[expr\ \{\$x+\$d\}\]\ \[expr\ \{\$y+\$d\}\]\]\n\ \}\n\ proc\ MMove\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ when\ mouse\ moves\n\ \ \ \ global\ ddata\ S\n\ \ \ \ if\ \{\$S(build)\ ==\ 1\ ||\ \$ddata(done)\}\ return\n\ \ \ \ .c\ delete\ xline\n\ \ \ \ set\ x\ \[.c\ canvasx\ \$x\]\ \;\ set\ y\ \[.c\ canvasy\ \$y\]\n\ \ \ \ .c\ create\ line\ \[concat\ \$ddata(\$ddata(last))\ \$x\ \$y\]\ -tag\ xline\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -fill\ \$S(color)\n\ \n\ \ \ \ if\ \{\[.c\ find\ withtag\ target\]\ ==\ \"\"\}\ return\n\ \ \ \ foreach\ \{x1\ y1\ x2\ y2\}\ \[.c\ bbox\ target\]\ break\ \;#\ Target\ for\ valid\ click\n\ \ \ \ if\ \{\$x\ <\ \$x1\ ||\ \$y\ <\ \$y1\ ||\ \$x\ >\ \$x2\ ||\ \$y\ >\ \$y2\}\ \{\n\ \ \ \ \ \ \ \ .c\ itemconfig\ target\ -fill\ green\ -outline\ green\n\ \ \ \ \ \ \ \ set\ S(out)\ 1\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ .c\ itemconfig\ target\ -fill\ red\ -outline\ red\n\ \ \ \ \ \ \ \ if\ \{\$S(out)\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ PlaySound\ enter\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ S(out)\ 0\n\ \ \ \ \}\ \ \ \ \n\ \}\n\ proc\ MDown\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ on\ mouse\ click\n\ \ \ \ global\ ddata\ dots\ xdots\ S\n\ \n\ \ \ \ set\ x\ \[expr\ \{int(\[.c\ canvasx\ \$x\])\}\]\ \;\ set\ y\ \[expr\ \{int(\[.c\ canvasy\ \$y\])\}\]\n\ \ \ \ if\ \{\$S(build)\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Build\ dot2dot\ mode\n\ \ \ \ \ \ \ \ lappend\ xdots\ \$x\ \$y\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Add\ to\ our\ list\n\ \ \ \ \ \ \ \ set\ ddata(\[incr\ ddata(last)\])\ \[list\ \$x\ \$y\]\n\ \ \ \ \ \ \ \ DrawOneDot\ \$ddata(last)\n\ \ \ \ \ \ \ \ catch\ \{.c\ coords\ build\ \$xdots\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ if\ \{\$ddata(done)\}\ return\n\ \ \ \ foreach\ \{x1\ y1\ x2\ y2\}\ \[.c\ bbox\ target\]\ break\ \;#\ Target\ for\ valid\ click\n\ \ \ \ if\ \{\$x\ <\ \$x1\ ||\ \$y\ <\ \$y1\ ||\ \$x\ >\ \$x2\ ||\ \$y\ >\ \$y2\}\ return\n\ \ \ \ foreach\ a\ \[after\ info\]\ \{after\ cancel\ \$a\}\n\ \ \ \ PlaySound\ click\n\ \ \ \ ConnectDot\n\ \}\n\ proc\ M3Down\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Right-click\ ==\ undo\n\ \ \ \ global\ ddata\ dots\ xdots\ S\n\ \ \ \ if\ \{\$S(build)\ ==\ 0\}\ return\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Not\ in\ build\ mode\n\ \ \ \ if\ \{\$ddata(last)\ ==\ 0\}\ return\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Nothing\ to\ undo\n\ \ \ \ \n\ \ \ \ set\ xdots\ \[lrange\ \$xdots\ 0\ end-2\]\ \ \ \ \ \ \ \ \ \ \ \;#\ Remove\ last\ dot\n\ \ \ \ .c\ delete\ xline\ build\ d\$ddata(last)\ n\$ddata(last)\n\ \ \ \ .c\ create\ line\ -tag\ build\n\ \n\ \ \ \ incr\ ddata(last)\ -1\n\ \ \ \ if\ \{\$ddata(last)\ <=\ 0\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Completely\ empty\n\ \ \ \ \ \ \ \ set\ S(build)\ 1\n\ \ \ \ \ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ \}\ elseif\ \{\$ddata(last)\ >\ 1\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Some\ completed\ lines\n\ \ \ \ \ \ \ \ .c\ coords\ build\ \$xdots\n\ \ \ \ \}\n\ \ \ \ if\ \{\$x\ !=\ -1\}\ \{\ MMove\ \$x\ \$y\ \}\n\ \}\n\ proc\ ConnectDot\ \{\{all\ 0\}\}\ \{\n\ \ \ \ global\ ddata\ S\n\ \n\ \ \ \ .c\ delete\ xline\ target\n\ \ \ \ while\ \{1\}\ \{\n\ \ \ \ \ \ \ \ .c\ create\ line\ \[concat\ \$ddata(\$ddata(last))\ \$ddata(\$ddata(next))\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -fill\ black\ -width\ 3\ -tag\ line\ -fill\ \$S(color)\n\ \ \ \ \ \ \ \ incr\ ddata(last)\n\ \ \ \ \ \ \ \ incr\ ddata(next)\n\ \ \ \ \ \ \ \ if\ \{\$ddata(last)\ ==\ \$ddata(end)\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ DonePuzzle\n\ \ \ \ \ \ \ \ \ \ \ \ break\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ MakeTarget\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{!\ \$all\}\ break\n\ \ \ \ \}\n\ \}\n\ proc\ MakeTarget\ \{\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Draws\ where\ next\ click\ goes\n\ \ \ \ global\ ddata\ S\n\ \ \ \ .c\ delete\ target\n\ \n\ \ \ \ foreach\ \{x\ y\}\ \$ddata(\$ddata(next))\ break\n\ \ \ \ set\ xy\ \[MakeBox\ \$x\ \$y\ \$S(r2)\]\n\ \ \ \ .c\ create\ oval\ \$xy\ -tag\ target\ -fill\ green\ -outline\ green\n\ \}\n\ proc\ DonePuzzle\ \{\}\ \{\n\ \ \ \ global\ ddata\ dots\n\ \ \ \ \n\ \ \ \ set\ ddata(done)\ 1\n\ \ \ \ if\ \{\$ddata(close)\}\ \{\n\ \ \ \ \ \ \ \ eval\ .c\ create\ line\ \$ddata(\$ddata(last))\ \$ddata(1)\ -fill\ black\ -width\ 3\n\ \ \ \ \}\n\ \ \ \ .c\ delete\ target\n\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ yellow\n\ \ \ \ .c\ lower\ done\n\ \n\ \ \ \ #\ Add\ to\ our\ pick\ puzzle\ widget\n\ \ \ \ destroy\ .p\n\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \ \ \ pack\ .p\ -in\ .pf\ -side\ right\n\ \}\n\ proc\ ToggleBuildMode\ \{\}\ \{\n\ \ \ \ if\ \{\$::S(build)\}\ \{\n\ \ \ \ \ \ \ \ GoBuildMode\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ set\ n\ \[Done\]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Finish\ off\ this\ build\n\ \ \ \ \ \ \ \ if\ \{!\ \$n\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ DoDots\ -2\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \}\n\ proc\ GoBuildMode\ \{\{ifile\ \"\"\}\}\ \{\n\ \ \ \ Clear\n\ \ \ \ set\ ::S(build)\ 1\n\ \n\ \ \ \ catch\ \{image\ delete\ d2d\}\n\ \ \ \ if\ \{\$ifile\ !=\ \"\"\}\ \{\n\ \ \ \ \ \ \ \ image\ create\ photo\ d2d\ -file\ \$ifile\n\ \ \ \ \ \ \ \ .c\ create\ image\ 0\ 0\ -anchor\ c\ -image\ d2d\ -tag\ image\n\ \ \ \ \ \ \ \ .c\ lower\ image\n\ \ \ \ \}\ \ \ \ \n\ \}\n\ proc\ Clear\ \{\{all\ 1\}\}\ \{\n\ \ \ \ global\ xdots\ ddata\n\ \ \ \ \n\ \ \ \ .c\ delete\ done\ target\ xline\n\ \ \ \ if\ \{\$all\}\ \{.c\ delete\ all\}\n\ \ \ \ catch\ \{unset\ ddata\}\n\ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ set\ ddata(done)\ 0\n\ \ \ \ set\ xdots\ \{\}\ \n\ \ \ \ .c\ create\ line\ -tag\ build\n\ \ \ \ catch\ \{image\ delete\ d2d\}\n\ \}\n\ proc\ Copy\ \{\}\ \{\n\ \ \ \ global\ dots\ ddata\ xdots\n\ \n\ \ \ \ regsub\ -all\ \{\\.0\}\ \$xdots\ \{\}\ xdots\n\ \ \ \ clipboard\ clear\n\ \ \ \ clipboard\ append\ \$xdots\n\ \ \ \ set\ len\ \[expr\ \{\[llength\ \$xdots\]\ /\ 2\}\]\n\ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ set\ ddata(done)\ 0\n\ \ \ \ set\ xdots\ \{\}\n\ \}\n\ proc\ Done\ \{\}\ \{\n\ \ \ \ global\ dots\ extra\ xdots\n\ \ \ \ if\ \{\[llength\ \$xdots\]\ <=\ 3\}\ \{return\ 0\}\n\ \n\ \ \ \ for\ \{set\ cnt\ 1\}\ \{1\}\ \{incr\ cnt\}\ \{\n\ \ \ \ \ \ \ \ set\ name\ \"n\$cnt\"\n\ \ \ \ \ \ \ \ if\ \{!\ \[info\ exists\ dots(\$name)\]\}\ break\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ set\ dots(\$name)\ \$xdots\n\ \ \ \ lappend\ dots(\$name)\ 999\ 999\n\ \ \ \ set\ extra(\$name)\ \{\}\n\ \ \ \ Copy\n\ \ \ \ DoDots\ \$name\n\ \ \ \ return\ 1\n\ \}\n\ proc\ ScaleIt\ \{n\ s\}\ \{\n\ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ set\ d2\ \[set\ e2\ \{\}\]\n\ \ \ \ foreach\ \{x\ y\}\ \$dots(\$n)\ \{\n\ \ \ \ \ \ \ \ if\ \{\$x\ !=\ 999\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ set\ x\ \[expr\ \{round(\$x\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ y\ \[expr\ \{round(\$y\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ lappend\ d2\ \$x\ \$y\n\ \ \ \ \}\n\ \ \ \ foreach\ \{x\ y\}\ \$extra(\$n)\ \{\n\ \ \ \ \ \ \ \ if\ \{\[string\ is\ double\ \$x\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ set\ x\ \[expr\ \{round(\$x\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ y\ \[expr\ \{round(\$y\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ lappend\ e2\ \$x\ \$y\n\ \ \ \ \}\n\ \ \ \ set\ dots(\$n)\ \$d2\n\ \ \ \ set\ extra(\$n)\ \$e2\n\ \ \ \ DoDots\ \$n\n\ \ \ \ clipboard\ clear\n\ \ \ \ clipboard\ append\ \"set\ dots(\$n)\ \{\$d2\}\\n\"\n\ \ \ \ clipboard\ append\ \"set\ extra(\$n)\ \{\$e2\}\\n\"\n\ \}\n\ \n\ proc\ Shapes\ \{\}\ \{\n\ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ set\ dots(0)\ \{-286\ -8\ -242\ -18\ -217\ -37\ -191\ -66\ -176\ -89\ -173\ -133\ -146\n\ \ \ \ \ \ \ \ -132\ -103\ -106\ -51\ -134\ -2\ -147\ 56\ -156\ 136\ -156\ 222\ -132\ 248\ -137\n\ \ \ \ \ \ \ \ 288\ -177\ 297\ -176\ 293\ -147\ 280\ -119\ 298\ -95\ 298\ -69\ 309\ -32\ 310\ 29\n\ \ \ \ \ \ \ \ 270\ 110\ 233\ 223\ 177\ 231\ 157\ 156\ 80\ 152\ 0\ 152\ -54\ 231\ -104\ 231\ -107\n\ \ \ \ \ \ \ \ 135\ -174\ 115\ -227\ 88\ -284\ 38\ 999\ 999\}\n\ \ \ \ set\ extra(0)\ \{c\ 12\ -118\ -36\n\ \ \ \ \ \ \ \ l\ 5\ -129\ 127\ -116\ 122\ -93\ 110\ -78\ 92\ -65\ 67\n\ \ \ \ \ \ \ \ l\ 12\ 294\ -180\ 308\ -186\ 317\ -195\ 315\ -201\ 306\ -208\ 297\ -214\ 294\ -225\ 304\n\ \ \ \ \ \ \ \ -233\ 316\ -234\ 321\ -220\ 318\ -218\ 309\ -219\}\n\ \ \ \ set\ dots(1)\ \{34\ -114\ 57\ -133\ 90\ -145\ 145\ -139\ 208\ -91\ 224\ -30\ 221\ 45\ 196\ 117\n\ \ \ \ \ \ \ \ 129\ 199\ 59\ 241\ 26\ 235\ -7\ 228\ -45\ 239\ -110\ 207\ -163\ 149\ -191\ 66\ -197\ -19\n\ \ \ \ \ \ \ \ -161\ -90\ -112\ -131\ -45\ -138\ -6\ -108\ 999\ 999\}\n\ \ \ \ set\ extra(1)\ \{\n\ \ \ \ \ \ \ \ l\ 11\ -99\ -87\ -111\ -77\ -130\ -54\ -139\ -38\ -151\ -11\ -159\ 22\ -165\ -3\ -162\n\ \ \ \ \ \ \ \ \ \ \ \ \ -27\ -151\ -55\ -134\ -73\ -99\ -87\n\ \ \ \ \ \ \ \ p\ 20\ 36\ -233\ 26\ -217\ 20\ -202\ 15\ -182\ 14\ -160\ 18\ -124\ 23\ -99\ 20\ -92\ 16\n\ \ \ \ \ \ \ \ \ \ \ \ \ -80\ 8\ -77\ 5\ -96\ -2\ -119\ -7\ -152\ -8\ -173\ -5\ -203\ 0\ -231\ 11\ -253\ 16\n\ \ \ \ \ \ \ \ \ \ \ \ \ -241\ 26\ -232\ 36\ -233\n\ \ \ \ \ \ \ \ l\ 14\ 8\ -88\ -14\ -98\ -7\ -85\ -15\ -76\ -25\ -76\ -2\ -73\ 1\ -58\ 10\ -75\ 23\ -65\ 26\n\ \ \ \ \ \ \ \ \ \ \ \ \ -79\ 46\ -79\ 30\ -88\ 39\ -98\ 21\ -96\n\ \ \ \ \}\n\ \ \ \ set\ dots(2)\ \{-106\ -114\ -94\ -153\ -51\ -174\ -11\ -160\ 7\ -131\ 6\ -87\ -28\ -26\ 22\n\ \ \ \ \ \ \ \ -28\ 75\ -13\ 100\ -69\ 119\ 12\ 96\ 55\ 43\ 81\ -34\ 88\ -91\ 61\ -111\ 11\ -83\ -46\ -80\n\ \ \ \ \ \ \ \ -72\ -128\ -58\ -166\ -85\ 999\ 999\}\n\ \ \ \ set\ extra(2)\ \{\n\ \ \ \ \ \ \ \ p\ 6\ -75\ -124\ -72\ -119\ -74\ -111\ -77\ -109\ -82\ -116\ -81\ -123\n\ \ \ \ \ \ \ \ p\ 4\ -67\ -137\ -63\ -126\ -60\ -130\ -65\ -141\n\ \ \ \ \ \ \ \ l\ 7\ -144\ -70\ -133\ -71\ -119\ -71\ -108\ -76\ -98\ -87\ -102\ -90\ -96\ -86\n\ \ \ \ \ \ \ \ l\ 6\ -39\ 10\ -23\ 43\ 0\ 48\ 37\ 46\ 55\ 37\ 66\ 20\n\ \ \ \ \ \ \ \ l\ 4\ 8\ 26\ 29\ 29\ 44\ 26\ 55\ 21\n\ \ \ \ \ \ \ \ l\ 3\ 10\ 15\ 27\ 16\ 47\ 14\n\ \ \ \ \ \ \ \ l\ 18\ -107\ 62\ -122\ 68\ -131\ 79\ -126\ 86\ -115\ 90\ -98\ 96\ -71\ 101\ -36\ 103\ -6\n\ \ \ \ \ \ \ \ \ \ \ \ \ 105\ 35\ 105\ 70\ 103\ 97\ 99\ 132\ 93\ 151\ 86\ 160\ 82\ 162\ 78\ 156\ 75\ 137\ 72\n\ \ \ \ \ \ \ \ l\ 22\ -144\ 71\ -158\ 77\ -172\ 83\ -182\ 90\ -188\ 98\ -181\ 103\ -158\ 110\ -119\ 119\n\ \ \ \ \ \ \ \ \ \ \ \ \ -81\ 122\ -53\ 124\ -20\ 126\ -4\ 131\ 28\ 131\ 55\ 131\ 83\ 127\ 119\ 124\ 149\ 120\n\ \ \ \ \ \ \ \ \ \ \ \ \ 175\ 110\ 187\ 106\ 189\ 100\ 184\ 96\ 177\ 94\n\ \ \ \ \ \ \ \ l\ 16\ -146\ 134\ -138\ 138\ -126\ 140\ -115\ 143\ -95\ 143\ -62\ 146\ -42\ 144\ -30\ 146\n\ \ \ \ \ \ \ \ \ \ \ \ \ -13\ 150\ 20\ 151\ 53\ 153\ 100\ 150\ 117\ 149\ 155\ 148\ 169\ 144\ 171\ 137\n\ \ \ \ \ \ \ \ l\ 6\ -208\ -19\ -198\ -20\ -187\ -26\ -184\ -23\ -174\ -19\ -170\ -19\n\ \ \ \ \ \ \ \ l\ 5\ -182\ -14\ -169\ -18\ -153\ -25\ -149\ -23\ -132\ -21\n\ \ \ \ \ \ \ \ l\ 5\ -145\ -15\ -132\ -17\ -121\ -23\ -115\ -20\ -108\ -22\n\ \ \ \ \ \ \ \ l\ 17\ -159\ -225\ -151\ -222\ -127\ -224\ -110\ -224\ -96\ -222\ -80\ -221\ -72\ -227\n\ \ \ \ \ \ \ \ \ \ \ \ \ -55\ -227\ -45\ -230\ -60\ -232\ -75\ -232\ -85\ -236\ -102\ -237\ -117\ -237\n\ \ \ \ \ \ \ \ \ \ \ \ \ -127\ -234\ -148\ -232\ -159\ -225\n\ \ \ \ \}\n\ \ \ \ set\ dots(3)\ \{-231\ -76\ -211\ -95\ -188\ -78\ -162\ -110\ -116\ -119\ -69\ -138\ 14\ -130\n\ \ \ \ \ \ \ \ 3\ -158\ 45\ -155\ 37\ -187\ 81\ -184\ 69\ -201\ 111\ -212\ 113\ -247\ 152\ -225\ 171\n\ \ \ \ \ \ \ \ -259\ 175\ -223\ 199\ -208\ 233\ -152\ 235\ -126\ 221\ -116\ 155\ -144\ 127\ -68\ 131\n\ \ \ \ \ \ \ \ -37\ 115\ -6\ 138\ 70\ 120\ 93\ 125\ 165\ 138\ 190\ 132\ 207\ 151\ 222\ 160\ 240\ 127\ 240\n\ \ \ \ \ \ \ \ 119\ 221\ 107\ 204\ 91\ 108\ 62\ 116\ 37\ 125\ 9\ 139\ -17\ 123\ 8\ 97\ 24\ 109\ 51\ 103\ 80\n\ \ \ \ \ \ \ \ 84\ 52\ 31\ 38\ 3\ -17\ -21\ -40\ -17\ -81\ 27\ -100\ 57\ -93\ 132\ -83\ 158\ -87\ 176\n\ \ \ \ \ \ \ \ -59\ 194\ -49\ 210\ -93\ 211\ -100\ 186\ -114\ 173\ -116\ 142\ -129\ 66\ -134\ 25\n\ \ \ \ \ \ \ \ -104\ -17\ -122\ -67\ -113\ -103\ -137\ -85\ -187\ -38\ -208\ -44\ -225\ -60\ 999\ 999\}\n\ \ \ \ set\ extra(3)\ \{l\ 4\ 169\ -243\ 163\ -230\ 163\ -225\ 160\ -220\n\ \ \ \ \ \ \ \ l\ 4\ 156\ -143\ 148\ -146\ 143\ -154\ 139\ -165\n\ \ \ \ \ \ \ \ l\ 7\ 153\ -227\ 140\ -220\ 127\ -208\ 107\ -188\ 85\ -156\ 68\ -144\ 15\ -128\n\ \ \ \ \ \ \ \ l\ 7\ 192\ -181\ 191\ -193\ 185\ -197\ 176\ -195\ 169\ -189\ 175\ -182\ 192\ -181\n\ \ \ \ \ \ \ \ l\ 3\ -47\ -71\ -45\ -51\ -33\ -30\n\ \ \ \ \ \ \ \ l\ 9\ 104\ -29\ 103\ -21\ 98\ -14\ 91\ -4\ 92\ 10\ 97\ 20\ 100\ 47\ 102\ 63\ 116\ 96\n\ \ \ \ \}\n\ \ \ \ set\ dots(4)\ \{\n\ \ \ \ \ \ \ \ -257\ -39\ -239\ -90\ -205\ -130\ -149\ -154\ -87\ -155\ -25\ -145\ 17\ -121\ -6\ -156\n\ \ \ \ \ \ \ \ -23\ -203\ 14\ -201\ 46\ -195\ 41\ -220\ 95\ -199\ 134\ -161\ 152\ -113\ 195\ -86\ 223\n\ \ \ \ \ \ \ \ -65\ 244\ -38\ 266\ -9\ 260\ 17\ 237\ 38\ 205\ 55\ 168\ 58\ 122\ 48\ 144\ 96\ 195\ 103\ 226\n\ \ \ \ \ \ \ \ 115\ 224\ 149\ 205\ 173\ 182\ 180\ 152\ 177\ 110\ 161\ 63\ 136\ 37\ 98\ -15\ 97\ -54\ 90\n\ \ \ \ \ \ \ \ -83\ 74\ -104\ 100\ -127\ 115\ -129\ 134\ -79\ 131\ -30\ 130\ 12\ 140\ 27\ 174\ 4\ 179\n\ \ \ \ \ \ \ \ 29\ 205\ -31\ 221\ -101\ 223\ -176\ 222\ -227\ 218\ -263\ 207\ -262\ 175\ -212\ 115\n\ \ \ \ \ \ \ \ -244\ 91\ -259\ 63\}\n\ \ \ \ set\ extra(4)\ \{l\ 6\ 122\ 47\ 107\ 76\ 121\ 104\ 156\ 119\ 199\ 122\ 223\ 148\n\ \ \ \ \ \ \ \ l\ 7\ -132\ -36\ -104\ -23\ -86\ -3\ -76\ 21\ -73\ 44\ -77\ 60\ -83\ 73\n\ \ \ \ \ \ \ \ l\ 11\ -128\ 115\ -147\ 118\ -165\ 126\ -177\ 141\ -180\ 159\ -167\ 167\ -138\ 174\n\ \ \ \ \ \ \ \ -97\ 174\ -55\ 174\ -28\ 173\ 3\ 177\n\ \ \ \ \ \ \ \ c\ 2\ 193\ -34\ c\ 5\ 193\ -34\ c\ 8\ 193\ -34\n\ \ \ \ \ \ \ \ l\ 4\ 18\ -122\ 40\ -106\ 61\ -95\ 95\ -88\n\ \ \ \ \ \ \ \ l\ 8\ -24\ -204\ -5\ -184\ 20\ -164\ 52\ -140\ 86\ -120\ 111\ -108\ 122\ -105\ 127\ -99\n\ \ \ \ \ \ \ \ l\ 7\ 47\ -196\ 62\ -185\ 79\ -175\ 93\ -162\ 108\ -146\ 123\ -128\ 140\ -104\n\ \ \ \ \ \ \ \ l\ 5\ 263\ 17\ 254\ 20\ 247\ 20\ 242\ 15\ 241\ 7\n\ \ \ \ \ \ \ \ l\ 7\ 265\ -11\ 257\ -19\ 249\ -11\ 248\ -1\ 253\ 7\ 261\ 6\ 265\ -8\n\ \ \ \ \ \ \ \ L\ 27\ -259\ 63\ -266\ 69\ -275\ 65\ -282\ 58\ -275\ 48\ -281\ 48\ -289\ 46\ -282\ 40\n\ \ \ \ \ \ \ \ \ \ \ \ \ -291\ 36\ -295\ 31\ -289\ 21\ -300\ 18\ -298\ 11\ -293\ 7\ -297\ 1\ -294\ -2\ -289\n\ \ \ \ \ \ \ \ \ \ \ \ \ -6\ -297\ -15\ -293\ -21\ -289\ -25\ -296\ -32\ -293\ -39\ -280\ -42\ -279\n\ \ \ \ \ \ \ \ \ \ \ \ -47\ -271\ -54\ -263\ -49\ -257\ -39\}\n\ \ \ \ set\ dots(5)\ \{84\ -133\ 72\ -93\ 77\ -51\ 110\ -6\ 104\ 38\ 86\ 77\ 115\ 129\ 123\ 205\ 88\n\ \ \ \ \ \ \ \ 266\ 20\ 289\ -38\ 275\ -86\ 257\ -128\ 209\ -130\ 136\ -115\ 99\ -87\ 62\ -102\ 23\n\ \ \ \ \ \ \ \ -107\ -21\ -68\ -66\ -75\ -118\ -75\ -144\ -110\ -150\ -62\ -188\ -93\ -242\ -42\ -262\n\ \ \ \ \ \ \ \ 56\ -266\ 68\ -198\ 115\ -167\ 72\ -161\ 999\ 999\}\n\ \ \ \ set\ extra(5)\ \{\n\ \ \ \ \ \ \ \ l\ 8\ -87\ 61\ -70\ 80\ -50\ 94\ -19\ 104\ 11\ 104\ 41\ 101\ 67\ 92\ 86\ 77\n\ \ \ \ \ \ \ \ l\ 5\ -59\ -59\ -40\ -45\ -6\ -28\ 33\ -27\ 59\ -38\ 75\ -52\n\ \ \ \ \ \ \ \ p\ 8\ -34\ -59\ -12\ -49\ 15\ -45\ 41\ -49\ 50\ -63\ 34\ -59\ 14\ -55\ -5\ -56\n\ \ \ \ \ \ \ \ p\ 9\ -38\ -175\ -5\ -171\ 28\ -176\ 45\ -177\ 59\ -185\ 56\ -190\ 39\ -185\ 11\ -186\n\ \ \ \ \ \ \ \ \ \ \ \ -18\ -177\n\ \ \ \ \ \ \ \ p\ 9\ -7\ -113\ -19\ -117\ -11\ -131\ 3\ -129\ 9\ -119\ 10\ -106\ -1\ -96\ -13\ -97\n\ \ \ \ \ \ \ \ \ \ \ \ -18\ -106\n\ \ \ \ \ \ \ \ p\ 9\ 48\ -118\ 36\ -121\ 42\ -133\ 55\ -134\ 62\ -123\ 60\ -113\ 55\ -104\ 42\ -102\n\ \ \ \ \ \ \ \ \ \ \ \ 36\ -110\n\ \ \ \ \ \ \ \ p\ 14\ 108\ 5\ 210\ 34\ 231\ 27\ 242\ 25\ 243\ 34\ 230\ 41\ 239\ 46\ 258\ 50\ 253\ 59\ 215\n\ \ \ \ \ \ \ \ \ \ \ \ \ 54\ 219\ 64\ 213\ 69\ 173\ 39\ 105\ 17\n\ \ \ \ \ \ \ \ p\ 15\ -106\ -12\ -138\ -9\ -154\ -12\ -170\ -6\ -177\ -6\ -229\ -29\ -235\ -20\ -212\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -5\ -250\ 1\ -250\ 9\ -230\ 12\ -238\ 23\ -230\ 31\ -207\ 10\ -104\ 4\n\ \ \ \ \ \ \ \ l\ 8\ 60\ -79\ 30\ -104\ 16\ -100\ 7\ -88\ 9\ -74\ 14\ -68\ 29\ -68\ 60\ -79\}\n\ \ \ \ set\ dots(6)\ \{-10\ 145\ -57\ 165\ -94\ 150\ -116\ 121\ -112\ 80\ -75\ 54\ -31\ 59\ -86\ -3\n\ \ \ \ \ \ \ \ -106\ -69\ -92\ -131\ -54\ -155\ -20\ -115\ 3\ -162\ 48\ -182\ 82\ -212\ 124\ -219\ 153\n\ \ \ \ \ \ \ \ -199\ 164\ -162\ 164\ -115\ 155\ -42\ 132\ 13\ 145\ 35\ 138\ 60\ 117\ 77\ 112\ 101\ 94\n\ \ \ \ \ \ \ \ 120\ 57\ 129\ 50\ 148\ 66\ 203\ 113\ 189\ 121\ 198\ 64\ 231\ 54\ 209\ 38\ 154\ 15\ 154\n\ \ \ \ \ \ \ \ -29\ 205\ -29\ 226\ -92\ 195\ -83\ 182\ -42\ 203\ 4\ 151\ 1\ 102\ 999\ 999\}\n\ \ \ \ set\ extra(6)\ \{\n\ \ \ \ \ \ \ \ c\ 2\ -40\ 104\ c\ 2\ -77\ 89\n\ \ \ \ \ \ \ \ l\ 6\ -33\ 124\ -45\ 140\ -63\ 142\ -88\ 130\ -95\ 119\ -93\ 107\n\ \ \ \ \ \ \ \ l\ 4\ -55\ 123\ -57\ 115\ -66\ 111\ -76\ 116\n\ \ \ \ \ \ \ \ l\ 11\ 0\ 100\ -4\ 84\ -13\ 71\ -32\ 57\ -26\ 61\ -13\ 46\ 0\ 38\ 8\ 37\ 25\ 40\ 21\ 64\ 23\ 90\n\ \ \ \ \ \ \ \ l\ 23\ 48\ -183\ 42\ -172\ 36\ -158\ 33\ -143\ 34\ -129\ 37\ -121\ 28\ -126\ 14\ -129\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ \ -126\ -8\ -118\ -17\ -109\ -21\ -93\ -22\ -73\ -18\ -56\ -12\ -38\ 1\ -7\ 13\ 13\n\ \ \ \ \ \ \ \ \ \ \ \ \ 6\ 26\ 8\ 37\ 5\ 25\ 13\ 12\ 30\ 35\ 24\ 40\n\ \ \ \ \ \ \ \ l\ 7\ 28\ 101\ 44\ 100\ 61\ 91\ 87\ 76\ 105\ 56\ 122\ 34\ 133\ 13\n\ \ \ \ \ \ \ \ l\ 4\ 56\ 128\ 59\ 117\ 62\ 105\ 60\ 90\n\ \ \ \ \ \ \ \ l\ 3\ 118\ 76\ 113\ 69\ 103\ 58\n\ \ \ \ \}\n\ \ \ \ set\ dots(7)\ \{-6\ -15\ 18\ 0\ 88\ -4\ 96\ 100\ 156\ 165\ 108\ 219\ 135\ 172\ 72\ 109\ 79\ 20\n\ \ \ \ \ \ \ \ 18\ 23\ -17\ 3\ -19\ 43\ 43\ 137\ 6\ 212\ 24\ 137\ -35\ 53\ -34\ 2\ -77\ 58\ -58\ 99\ -118\n\ \ \ \ \ \ \ \ 162\ -88\ 227\ -142\ 165\ -81\ 96\ -101\ 45\ -51\ -11\ -124\ 41\ -110\ 80\ -155\ 99\ -131\n\ \ \ \ \ \ \ \ 77\ -135\ 26\ -69\ -28\ -143\ -36\ -134\ -150\ -144\ -204\ -111\ -157\ -124\ -47\ -84\n\ \ \ \ \ \ \ \ -46\ -99\ -141\ -58\ -224\ -84\ -146\ -69\ -60\ -52\ -75\ -59\ -137\ -28\ -192\ 38\ -194\n\ \ \ \ \ \ \ \ 89\ -162\ 87\ -99\ 40\ -50\ 999\ 999\}\n\ \ \ \ set\ extra(7)\ \{\n\ \ \ \ \ \ \ \ l\ 10\ 62\ -94\ 56\ -87\ 42\ -84\ 32\ -92\ 22\ -97\ 11\ -97\ -1\ -92\ -10\ -96\ -12\ -105\n\ \ \ \ \ \ \ \ \ \ \ \ \ -6\ -110\n\ \ \ \ \ \ \ \ c\ 5\ 6\ -140\ c\ 5\ 56\ -115\n\ \ \ \ \}\n\ \ \ \ set\ dots(8)\ \{-97\ -46\ -126\ 46\ -91\ 111\ -95\ 231\ -129\ 267\ -84\ 267\ -66\ 253\ -57\n\ \ \ \ \ \ \ \ 151\ -34\ 210\ -4\ 234\ -48\ 267\ 95\ 267\ 108\ 249\ 151\ 244\ 172\ 207\ 176\ 134\ 200\n\ \ \ \ \ \ \ \ 36\ 190\ -20\ 162\ -69\ 127\ -31\ 108\ 13\ 141\ 105\ 139\ 161\ 81\ 22\ 13\ -97\ 45\ -95\n\ \ \ \ \ \ \ \ 36\ -130\ 1\ -160\ -13\ -192\ -50\ -218\ -70\ -252\ -85\ -244\ -80\ -207\}\n\ \ \ \ set\ extra(8)\ \{l\ 7\ -29\ 192\ -31\ 169\ -22\ 153\ -10\ 136\ 14\ 129\ 31\ 130\ 45\ 136\n\ \ \ \ \ \ \ \ p\ 4\ -4\ -137\ 3\ -118\ 32\ -106\ 18\ -129\ c\ 3\ -39\ -171\n\ \ \ \ \ \ \ \ L\ 9\ -80\ -207\ -99\ -238\ -112\ -239\ -112\ -220\ -108\ -196\ -109\ -175\ -109\ -150\n\ \ \ \ \ \ \ \ \ \ \ \ -108\ -113\ -97\ -46\}\n\ \ \ \ set\ dots(9)\ \{-72\ 102\ -98\ 161\ -107\ 207\ -122\ 219\ -122\ 236\ -81\ 240\ -47\ 227\n\ \ \ \ \ \ \ \ -53\ 189\ -30\ 147\ -3\ 206\ -21\ 237\ 10\ 255\ 39\ 254\ 51\ 234\ 46\ 162\ 36\ 111\n\ \ \ \ \ \ \ \ 94\ 129\ 76\ 191\ 67\ 212\ 108\ 227\ 129\ 206\ 139\ 162\ 157\ 134\ 213\ 177\ 199\ 218\n\ \ \ \ \ \ \ \ 234\ 230\ 265\ 218\ 252\ 150\ 211\ 105\ 232\ 24\ 187\ -37\ 139\ -69\ 91\ -72\ 85\ -96\n\ \ \ \ \ \ \ \ 39\ -108\ -3\ -108\ -42\ -133\ -126\ -127\ -164\ -148\ -179\ -184\ -164\ -201\ -144\n\ \ \ \ \ \ \ \ -199\ -134\ -183\ -125\ -201\ -138\ -222\ -167\ -226\ -191\ -213\ -204\ -180\ -197\n\ \ \ \ \ \ \ \ -145\ -183\ -123\ -171\ -103\ -155\ -84\ -185\ -75\ -122\ -45\ -99\ -33\ -68\ 6\ -71\ 78\n\ \ \ \ \ \ \ \ 999\ 999\}\n\ \ \ \ set\ extra(9)\ \{c\ 10\ -95\ -108\n\ \ \ \ \ \ \ \ l\ 12\ -75\ -95\ -32\ -104\ 6\ -98\ 18\ -83\ 23\ -70\ 22\ -54\ 4\ -36\ -16\ -20\ -35\ -11\n\ \ \ \ \ \ \ \ -56\ -11\ -67\ -20\ -76\ -40\}\n\ \ \ \ set\ dots(10)\ \{-268\ -8\ -272\ -39\ -244\ -80\ -177\ -120\ -121\ -132\ -70\ -196\ -33\n\ \ \ \ \ \ \ \ -224\ 13\ -220\ -14\ -176\ -25\ -120\ 41\ -98\ 107\ -42\ 161\ 34\ 183\ 84\ 208\ 94\ 262\n\ \ \ \ \ \ \ \ 93\ 293\ 113\ 281\ 126\ 226\ 150\ 202\ 186\ 191\ 218\ 163\ 198\ 155\ 168\ 158\ 120\ 117\n\ \ \ \ \ \ \ \ 73\ 49\ 29\ -2\ 12\ -49\ 8\ -53\ 41\ -16\ 83\ -62\ 88\ -80\ 83\ -110\ 57\ -152\ 29\ -207\n\ \ \ \ \ \ \ \ 39\ -239\ 31\}\n\ \ \ \ set\ extra(10)\ \{\n\ \ \ \ \ \ \ \ l\ 5\ -146\ 22\ -133\ 22\ -124\ 18\ -115\ 18\ -96\ 15\n\ \ \ \ \ \ \ \ L\ 7\ -239\ 33\ -300\ 68\ -313\ 67\ -319\ 52\ -312\ 42\ -268\ 0\ -267\ -9\n\ \ \ \ \ \ \ \ l\ 3\ -239\ 29\ -224\ -4\ -267\ -4\n\ \ \ \ \ \ \ \ l\ 5\ -257\ 18\ -256\ 23\ -260\ 33\ -272\ 43\ -287\ 59\n\ \ \ \ \ \ \ \ l\ 4\ -222\ -28\ -212\ -43\ -203\ -48\ -195\ -49\n\ \ \ \ \ \ \ \ l\ 6\ -219\ -37\ -218\ -27\ -207\ -25\ -204\ -32\ -208\ -40\ -219\ -37\n\ \ \ \ \ \ \ \ c\ 2\ -212\ -30\n\ \ \ \ \ \ \ \ l\ 6\ -205\ -93\ -212\ -89\ -211\ -81\ -200\ -84\ -191\ -93\ -201\ -97\n\ \ \ \ \ \ \ \ l\ 17\ -139\ -42\ -117\ -47\ -67\ -46\ -33\ -43\ 14\ -33\ 47\ -17\ 81\ 8\ 119\ 41\ 153\ 76\n\ \ \ \ \ \ \ \ \ \ \ \ \ 176\ 108\ 185\ 124\ 201\ 135\ 214\ 142\ 220\ 141\ 211\ 130\ 204\ 118\ 197\ 114\n\ \ \ \ \}\n\ \}\n\ proc\ DoSounds\ \{\}\ \{\n\ \ \ \ set\ ::S(sound)\ 0\n\ \ \ \ .sound\ config\ -state\ disabled\n\ \n\ \ \ \ if\ \{\[catch\ \{package\ require\ base64\}\]\}\ return\n\ \ \ \ if\ \{\[catch\ \{package\ require\ snack\}\]\}\ return\n\ \n\ \ \ \ .sound\ config\ -state\ normal\n\ \ \ \ foreach\ e\ \{snd_click\ snd_enter\}\ \{\n\ \ \ \ \ \ \ \ sound\ \$e\n\ \ \ \ \ \ \ \ regsub\ -all\ \{\ \}\ \[set\ ::\$e\]\ \{\}\ b64data\n\ \ \ \ \ \ \ \ \$e\ data\ \[::base64::decode\ \$b64data\]\n\ \ \ \ \}\n\ \ \ \ set\ ::S(sound)\ 1\n\ \}\n\ proc\ PlaySound\ \{what\}\ \{\n\ \ \ \ if\ \{!\ \$::S(sound)\}\ return\n\ \ \ \ set\ snd\ \"snd_\$what\"\n\ \ \ \ if\ \{\[info\ commands\ \$snd\]\ ==\ \"\"\}\ return\n\ \ \ \ after\ 1\ \[list\ \$snd\ play\ -blocking\ 0\]\n\ \}\n\ set\ snd_click\ \{\n\ \ \ \ UklGRrEHAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YY0HAAB/f39/gICAgICAgICA\n\ \ \ \ f39/fn9/f4CAgICAf3+AgICBgYGBf359fX5/gIGChISEgX14dXZ6f4OFiIuMiYB2bm52foSHio+S\n\ \ \ \ k4x+bWBXY3mHjY2NlZqSg3NtcXp6eHd5goqLiY6Nf2tqeIKLnLGrhmJCOWF8h4+xvJJ3WTJTeX6E\n\ \ \ \ ja+/mH1qUE5lfoKIlsK6h3tbL2l/go28xIR9Qz15gIq9w31+Qjp2f4a0y4yBbkM9b3mDls6zgnY3\n\ \ \ \ Q3d5goWSp8yxjoF4VRlVc3iHvdGGhVYlWnt6o9irf4NAKmh2fpnYuYOLRytleX2w2KKGg0cpYnZ9\n\ \ \ \ sdaiiXc7Qmx0jsbAknUvT32Dw7uhhXo+NGF1g7LPpoqEWj9GYXV+jK3gq4+FVihab3uJv9OWjXdE\n\ \ \ \ MmJxjqGsr4xqXm96iH1zflphcoqyv4xvaVNpiZSAf4qCgIiloJh+TFRja259nbiphnxnbGJfdpKX\n\ \ \ \ maKPbl1fX26JnKOYe3BiaXqMinyHgn18fYeAe29xiot2fYiIi4h7dn+Fl6eMamNmcYGFg5Gbjn56\n\ \ \ \ cHVzdYWXnpB+bmhgdIibqqWHbFpUYnGHm6igjXlrX1hohJWkjnd2e397en1/b2NufYKSoqqUe2hb\n\ \ \ \ VVtte5KjpKKhgmFaZ3B3f5GclYp/gnxyamdwgIyapaGOgXFdaHeBhYN9h5eMjImBfm1pfIJ/g46W\n\ \ \ \ iXx1cm92gYeKkZeNf3h7fGhbaHmAkamqnIt1X09Vb3+PoqSQhXFcYXGAhI+moYp2alZRbIKLm62t\n\ \ \ \ mHtkTk9hc4KVpKmehHBlXmh4hI6TlpOMdmpnaHOBi5OUjoRwcG5tfIWLj5GPgXl8fXyChICDeWpt\n\ \ \ \ d3qCiYyLjI2BfYJ9d3d3fIB/h4h+enh+g4OHhoKAeXV5gIOCgoOAfHd7gYeNj4+LgXNsam12foOM\n\ \ \ \ jYqLhoB+eXqDhYeMhHVtam55h4yNjYd/fH18fH6AgYGCgoWJhnxxbnR8g4uQjIN7eXt5e36AgYGE\n\ \ \ \ h4N8eXp+goSEg358e3l7gIGEh4WDgHl3eHqAhYeIhoJ7dnV3fYKEhoWDgHt8gYSGhX95dXV3fYSJ\n\ \ \ \ iYWDfXl6e31+gYSEg4SCfXp4d3Z5gYmNjIh+c3F0e4OHiYuKhX56eHh5fYGDg4F/fn1/hYaDgX16\n\ \ \ \ eHl9gIOFh4mGgHx6d3Z6gYaJiIWCfXl4eXyBhIOBfn+Cg4SFg396dHJ0eoOLjouFgH57e36AgH58\n\ \ \ \ enp7fYCFioiFgX17ent9fH+Cg4F/fn+Af3+AgYODg4OBfnt4d3l8foGFiYmGg4F/e3h2d3uAhIaH\n\ \ \ \ hYJ+e3t+gIGChIOAfXp5eXt+gIOFhoOCg4F+fX19fXx8fX6AgYKDgX9/goOCgH58e3l5fICDhYaF\n\ \ \ \ g4B9fn9+fXx8fH6AgoSFhYKAfnp6e35/gYKDgoB/f3+AgIGCgICAgIGBfnp4eHyAhouNi4V8c29x\n\ \ \ \ eYGIjY2Gfnh1eHyBg4ODg4F+fX5+fXt7fYCEiImGgXx2dHd9g4eIh4WBfXp5e36ChoaDf3p4eXx+\n\ \ \ \ gYWGhYKAfXp7fH6Ag4SDf318fH1+gYSEgoB9fH1/goODgYB9e3t8gISIiIaAenZ2eX2Ch4qIhYB6\n\ \ \ \ d3h6foGFh4aDgH17ent9f4GCg4OCgX9+fX19fXx9gIKEhYSBfnt6enx/g4SDgYB/fn59fX1+gIGB\n\ \ \ \ goOCf3x7fH1/gYODgH9/f39/gYGAf318e31/goOEhIJ/fHp6fYCDhYWDf3x6e32Ag4WFhIF+fHt8\n\ \ \ \ fX+AgYOEhIF/fHp6fYGEhYWDf3t6e32Ag4aGg397enp7foCCg4OCgH9+fn5+f4CBgYGAf359fX5+\n\ \ \ \ foGDhIWFgn57eHh6foKFhoSAfHp6fICEh4eDfnp4eHt/goSFhIF+fHx9gIKDgoF/fXx8fn+BgoKC\n\ \ \ \ gYCAf359foCAgYB/fn9/f4CBgYB+fn+AgYKCgX99fX1+gIGCgoGAfn18fX5/gYOEg4F+fHt7fX+C\n\ \ \ \ g4OCgH58fHx+gIOEhIOBfnx7e31/gYOEhIKAfXx8fn+AgYGAf35+f3+BgoKBgH99fX5/gIGBgYB/\n\ \ \ \ fn1+f4GDg4OAfnx8fH6AgoODgX59fX5/gYGBgIB/f3+AgYGBgH9+fn5/f4CAgICAgH9+fX5+gIGC\n\ \ \ \ goF/fn19fX+AgoKCgYB/fn19foCBgoKAf359fn5/gIGBgIB/f39+fn5+f4CBgoKBgH9+fX1+gIGB\n\ \ \ \ gYGAgH9/fn9/f39/f3+AgICAgICAgIB/f39/f4CAgICAgICAgYCAf35+f39/gIGAgH9+fn5/gIGC\n\ \ \ \ goB/fn1+fn+AgYGAf39/f3+AgICAgIB/f39/f3+AgICAgICAgH9/fn5/f4CAgIB/f39/gICAgIB/\n\ \ \ \ f35+fn9/gIGBgIB/f39/f39/f39/f39/f4CBgYGBgH9+fX1+gIGCgoGAfn5+fn+AgYGAf35+fn5/\n\ \ \ \ gIGBgYB/f35+f3+AgICAf39/f3+AgICAgH9/f39/gICAf39/f3+AgICAgICAf39/f3+AgICAgICA\n\ \ \ \ f39/f39/gICAgIB/f4CAgH9/f39/f3+AgICAgICAf39/f4CAgICA\n\ \}\n\ set\ snd_enter\ \{\n\ \ \ \ UklGRkACAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YRwCAACA\n\ \ \ \ gId0ZHZbU5aMj7/MsIZ6UX6nWIiITWiIRUGUlZesvrGCiKiKTl96Fit3YF5e\n\ \ \ \ mrGHqcqhlJuAdWxgW01EbWSHubW1uJ2MkqGPYFVSamtvgHmEh5ybraWLkHp5\n\ \ \ \ Xm5oWGRvb3WSlYqMi4+JhY6Ac25xdXp5jYR/hoODdIN8e356goCHgoqGgIV/\n\ \ \ \ g35/d3N2eHZ6gIOIgouHioaNioGAfHpycHp2dH2HiouNiYiKhIF9enZzd3l+\n\ \ \ \ dX2BgYKIjoaJhIJ/fX6AfHl8fICAgICEgISFhYF/gH+AfIJ/gH6AfX6AfICA\n\ \ \ \ fYB+gn2DfoGAgIOAgYB8e3x9gIKChYCDgIN/g32Afn+BgIF+gH+BgIOAgX2C\n\ \ \ \ fYGAgIB/gH9/fIB/gICBgH+Df4KAgIB9gHuBfYKAgoCAhICDgIN+gH+Af4CA\n\ \ \ \ gIGAg4CFgIOAgICAgH9/f32AfoF/gn+BgICAf4B/gICAgICAgIKAgYCAgH+A\n\ \ \ \ fYB8f4CAgoGBgIKBgHt0cnqEi4yIhoKHioOBeoF+gHRvbW10eYSHhoyMmI+P\n\ \ \ \ hIF5dm9tbW92fICJjpKRkY6JhHx5b2xlbnWAhYeOjpSQkIiAe3R1cnNzdnx/\n\ \ \ \ gomLj4yJhICAfHp3d3d6fYKDhoKGgIeAhX1/eXt9foCAg4GCg4CDfYF6gHmA\n\ \ \ \ fYCBgIR/h4CEf4B9fn98gHuEfYV/g4CAgn6Fe4R6gn1/gHuDe4V+g4CAgn8=\n\ \}\n\ \n\ ################################################################\n\ Shapes\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Load\ all\ our\ dot2dot\ shapes\n\ DoDisplay\n\ DoSounds\n\ DoDots\ -3\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Pick\ and\ show\ a\ puzzle\ \n\n----\nif\ \{0\}\ \{\n#\ patch\ code\ here,\ save\ and\ run\ as\ 'patch\ <file'.\n---\ dot2dot.tcl\ 2003-11-18\ 11:07:45.000000000\ -0500\n+++\ dot2dotv2.tcl\ \ \ \ \ \ \ 2003-11-18\ 11:07:53.000000000\ -0500\n@@\ -1,3\ +1,7\ @@\n+#!/bin/sh\n+#\ the\ next\ line\ restarts\ using\ wish\ \\\n+exec\ wish\ \"\$0\"\ \"\$@\"\n+\n\ \ ##+##########################################################################\n\ \ #\n\ \ #\ dot2dot.tcl\ -\ a\ simple\ dot-to-dot\ game\n@@\ -21,8\ +25,12\ @@\n\ \ set\ xdots\ \{\}\n\ \n\ \ proc\ DoDisplay\ \{\}\ \{\n+\n+\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n+\n\ \ \ \ \ wm\ title\ .\ \"Dot\ 2\ Dot\"\n-\ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\ -padx\ 5\ -pady\ 5\]\ \\\n+\ #\ \ -padx\ 5\ -pady\ 5\]\n+\ \ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\]\ \\\n\ \ \ \ \ \ \ \ \ -side\ right\ -fill\ both\ -ipady\ 5\n\ \ \ \ \ pack\ \[frame\ .top\ -relief\ raised\ -bd\ 2\]\ -side\ top\ -fill\ x\n\ \ \ \ \ pack\ \[frame\ .screen\ -bd\ 2\ -relief\ raised\]\ -side\ top\ -fill\ both\ -expand\ 1\n@@\ -32,7\ +40,6\ @@\n\ \ \ \ \ .c\ xview\ moveto\ 0\ \;\ .c\ yview\ moveto\ 0\n\ \ \ \ \ pack\ .c\ -in\ .screen\ -side\ top\ -fill\ both\ -expand\ 1\n\ \n-\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n\ \ \ \ \ lappend\ colors\ \[lindex\ \[.c\ config\ -bg\]\ 3\]\ black\n\ \ \ \ \ foreach\ color\ \$colors\ \{\n\ \ \ \ \ \ \ \ \ radiobutton\ .top.b\$color\ -width\ 1\ -padx\ 0\ -pady\ 0\ -bg\ \$color\ \\\n@@\ -61,12\ +68,14\ @@\n\ \ \ \ \ button\ .restart\ -text\ Restart\ -command\ \{DoDots\ -2\}\n\ \ \ \ \ button\ .next\ -text\ \"Next\ Puzzle\"\ -command\ \{DoDots\ -1\}\n\ \ \ \ \ button\ .random\ -text\ \"Random\ Puzzle\"\ -command\ \{DoDots\ -3\}\n+\ \ \ \ button\ .exit\ -text\ \"Exit\"\ -command\ \{exit\}\n\ \ \ \ \ frame\ .pf\ -bd\ \[.next\ cget\ -bd\]\ -relief\ raised\n\ \ \ \ \ label\ .pl\ -text\ \"\ Pick\ Puzzle\"\n\ \ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \n-\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\ -padx\ 5\n+\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\n+#\ -padx\ 5\n\ \ \ \ \ checkbutton\ .build\ -text\ \"Build\ Mode\"\ -variable\ S(build)\ -anchor\ w\ \\\n\ \ \ \ \ \ \ \ \ -command\ ToggleBuildMode\n\ \ \ \ \ button\ .done\ -text\ Done\ -command\ Done\n@@\ -84,6\ +93,7\ @@\n\ \ \ \ \ grid\ .next\ \ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .random\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .restart\ -in\ .ctrl\ -sticky\ ew\n+\ \ \ \ grid\ .exit\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .bframe\ -in\ .ctrl\ -sticky\ ew\ -row\ 11\n\ \ \ \ \ grid\ .sound\ -in\ .ctrl\ -sticky\ ew\ -row\ 51\n\ \ \ \ \ grid\ .about\ -in\ .ctrl\ -sticky\ ew\n@@\ -106,11\ +116,22\ @@\ \ \}\n\ \ proc\ ReColor\ \{\}\ \{\n\ \ \ \ \ global\ S\n-\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n-\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n+\n+\ \ \ \ .c\ itemconfig\ done\ -fill\ \$S(color)\n+\n+#\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n+#\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n+\ \ \ \ .c\ itemconfig\ xline\ -fill\ black\n+\ \ \ \ .c\ itemconfig\ line\ -fill\ black\n+\n\ \ \ \ \ .c\ itemconfig\ dot\ -fill\ \$S(color)\ -outline\ \$S(color)\n-\ \ \ \ .c\ itemconfig\ extra\ -fill\ \$S(color)\n-\ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ \$S(color)\}\n+\ \ \ \ .c\ itemconfig\ extra\ -fill\ black\n+\n+\ \ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ black\}\n+\n+\ \ \ \ .c\ lower\ done\n+\n+\ \ \ \ \ update\n\ \ \}\n\ \ proc\ TraceBuild\ \{var1\ var2\ op\}\ \{\n\ \ \ \ \ if\ \{\$::S(build)\}\ \{set\ s\ normal\}\ \{set\ s\ disabled\}\n@@\ -303,14\ +324,16\ @@\n\ \ \ \ \ .c\ create\ oval\ \$xy\ -tag\ target\ -fill\ green\ -outline\ green\n\ \ \}\n\ \ proc\ DonePuzzle\ \{\}\ \{\n-\ \ \ \ global\ ddata\ dots\n+\ \ \ \ global\ ddata\ dots\ S\n\ \n\ \ \ \ \ set\ ddata(done)\ 1\n\ \ \ \ \ if\ \{\$ddata(close)\}\ \{\n\ \ \ \ \ \ \ \ \ eval\ .c\ create\ line\ \$ddata(\$ddata(last))\ \$ddata(1)\ -fill\ black\ -width\ 3\n\ \ \ \ \ \}\n\ \ \ \ \ .c\ delete\ target\n-\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ yellow\n+\n+#\ \ \ \ \ set\ color\ yellow\n+\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ \$S(color)\n\ \ \ \ \ .c\ lower\ done\n\ \n\ \ \ \ \ #\ Add\ to\ our\ pick\ puzzle\ widget\n@@\ -377,6\ +400,9\ @@\n\ \ \ \ \ set\ extra(\$name)\ \{\}\n\ \ \ \ \ Copy\n\ \ \ \ \ DoDots\ \$name\n+\n+\ \ \ \ SaveShape\ \$name\n+\n\ \ \ \ \ return\ 1\n\ \ \}\n\ \ proc\ ScaleIt\ \{n\ s\}\ \{\n@@\ -405,7\ +431,68\ @@\n\ \ \ \ \ clipboard\ append\ \"set\ extra(\$n)\ \{\$e2\}\\n\"\n\ \ \}\n\ \n-\ proc\ Shapes\ \{\}\ \{\n+proc\ SaveShape\ \{name\}\ \{\n+\ \ \ \ global\ env\ totalcount\ dots\n+\ \ \ \ set\ h\ \$env(HOME)\n+\ \ \ \ set\ fout\ \[file\ join\ \$h\ \".dots\"\ \"dot.\$totalcount\"\]\n+#\ \ \ \ puts\ \"debug:\ saving\ to\ \$fout\"\n+\n+\ \ \ \ set\ str1a\ \"set\ dots(\$totalcount)\ \{\"\n+\ \ \ \ set\ str1b\ \"\}\"\n+\ \ \ \ set\ str2\ \"set\ extra(\$totalcount)\ \{\}\"\n+\n+\ \ \ \ set\ chan\ \[open\ \$fout\ \"w\"\]\n+\ \ \ \ puts\ \$chan\ \$str1a\n+\ \ \ \ puts\ \$chan\ \$dots(\$name)\n+\ \ \ \ puts\ \$chan\ \$str1b\n+\ \ \ \ puts\ \$chan\ \$str2\n+\ \ \ \ close\ \$chan\n+\n+\ \ \ \ incr\ totalcount\n+\ \ \ \ set\ fname\ \[file\ join\ \$h\ \".dots\"\ \"count\"\]\n+\ \ \ \ set\ chan\ \[open\ \$fname\ \"w\"\]\n+\ \ \ \ puts\ \$chan\ \$totalcount\n+\ \ \ \ close\ \$chan\n+\n+#\ now\ update\ the\ menu\ gadget\n+\ \ \ \ destroy\ .p\n+\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n+\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n+\ \ \ \ pack\ .p\ -in\ .pf\ -side\ right\n+\n+\}\n+\n+proc\ Shapes\ \{\}\ \{\n+\ \ global\ dots\ extra\ totalcount\ env\n+\n+\ \ \ \ set\ h\ \$env(HOME)\n+\n+\ \ \ \ set\ home\ \[file\ join\ \$h\ \".dots\"\]\n+\ \ \ \ set\ fname\ \[file\ join\ \$home\ \"count\"\]\n+#\ \ \ \ puts\ \"debug:\ checking\ for\ \$fname\"\n+\ \ \ \ if\ \[file\ exists\ \$fname\]\ \{\n+#\ \ \ \ \ \ puts\ \"debug:\ loading\ from\ file\ \$fname\"\n+\ \ \ \ \ \ \ set\ chan\ \[open\ \$fname\ \"r\"\]\n+\ \ \ \ \ \ \ set\ tcount\ \[read\ \$chan\]\n+\ \ \ \ \ \ \ regsub\ -all\ \{\\n\}\ \$tcount\ \"\"\ totalcount\n+#\ \ \ \ \ \ puts\ \"debug:\ totalcount\ is\ \$totalcount.\"\n+\ \ \ \ \ \ \ close\ \$chan\n+\n+\ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$totalcount\}\ \{incr\ i\}\ \{\n+\ \ \ \ \ \ \ \ \ \ \ set\ fname\ \[file\ join\ \$home\ \"dot.\$i\"\]\n+#\ \ \ \ \ \ \ \ \ \ puts\ \"debug:\ sourcing\ \$fname\"\n+\ \ \ \ \ \ \ \ \ \ \ source\ \$fname\n+\ \ \ \ \ \ \ \}\n+\n+\ \ \ \ \}\ else\ \{\n+#\ \ \ \ \ \ puts\ \"debug:\ loading\ defaults\"\n+\ \ \ \ \ \ \ defShapes\n+\ \ \ \ \}\n+\n+\}\n+\n+\n+\ proc\ defShapes\ \{\}\ \{\n\ \ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ \ set\ dots(0)\ \{-286\ -8\ -242\ -18\ -217\ -37\ -191\ -66\ -176\ -89\ -173\ -133\ -146\n@@\ -649,8\ +736,8\ @@\n\ \ \}\n\ \n\ \ ################################################################\n+set\ totalcount\ 0\;\ #\ initialize\ global\ to\ no\ images\ loaded\ yet\n\ \ Shapes\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Load\ all\ our\ dot2dot\ shapes\n\ \ DoDisplay\n\ \ DoSounds\n\ \ DoDots\ -3\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Pick\ and\ show\ a\ puzzle\n-\n\n#\ end\ of\ comment\ loop\ around\ patch\n\}\n\n----\n\[\[\n\[Category\ Application\]\n|\n\[Category\ Games\]\n|\n\[Tcl/Tk\ games\]\n\]\] regexp2} CALL {my render {Dot to Dots} \[Keith\ Vetter\]\ 2002-10-21\ -\ I\ threw\ together\ a\ quick\ little\ dot-to-dot\ game.\ I\ designed\ it\ for\ my\ 3-year\ old\ daughter,\ so\ it's\ intended\ to\ be\ easy\ to\ use:\ the\ target\ next\ dot\ gets\ enlarged\ and\ highlighted,\ you\ don't\ drag\ &\ drop\ but\ just\ click,\ a\ line\ is\ drawn\ from\ the\ last\ dot\ to\ the\ mouse,\ etc.\n\n\n''\[KPV\]''\ 2003-02-28\ --\ I've\ put\ up\ an\ updated\ version\ of\ \n''Dot\ to\ Dots''.\ This\ version\ includes\ more\ puzzles,\ a\ revamped\ GUI,\ better\ build\ mode\nand\ sound\ effects\ (only\ if\ you\ have\ the\ base64\ and\ snack\ packages).\ \n\n''\[escargo\]''\ --\ When\ I\ used\ wish-reaper\ to\ download\ this\ and\ tried\ to\ run\ it\ on\ my\nWindows\ XP\ box\ with\ \[ActiveTcl\]\ 8.4.1\ I\ got\ this\ message:\n''illegal\ character\ found\ in\ input\ while\ executing...''\n\n''\[KPV\]''\ -\ investigation\ revealed\ that\ this\ is\ a\ bug\ in\ \[tcllib\]'s\ \[base64\]\npackage--it\ barfing\ on\ leading\ spaces.\ (Actually\ the\ bug\ is\ in\ \[Trf\]\ which\ gets\nused\ for\ speed\ up,\ the\ tcl-only\ version\ works\ correctly.\ ActiveTcl\ version\ 4.1a\ \nand\ 4.1.0\ didn't\ include\ Trf\ while\ 4.1.1\ does.)\ \nRFC2045,\ which\ defines\ base64,\ specifically\ says\ that\ all\ncharacters\ outside\ the\ base64\ alphabet\ should\ be\ ignored.\ Anyway,\ I\ fixed\ it\ by\ncleaning\ up\ the\ data\ before\ passing\ it\ to\ the\ base64\ decoder.\n\n''\[escargo\]''\ --\ I\ reaped\ the\ newer\ version\ and\ found\ that\ it\ behaves\ correctly.\nWould\ it\ make\ sense\ to\ do\ your\ own\ volume\ control?\ \ Or\ is\ that\ something\ more\ appropriate\nto\ leave\ to\ external\ sound\ processing?\n\n''\[Sandy\]''\ --\ I've\ put\ a\ 'diff'\ here\ (save\ and\ use\ \"patch\ <dot2dot.patch\"\ to\ apply)\ that\ improves\ the\ color\nchanges\ (color\ change\ changes\ item\ base\ color,\ e.g.\ red\ or\ green\ apple),\ and\ automatically\ saves\ new\ dot2dots\nmade\ in\ the\ Build\ function\ into\ a\ \".dots\"\ directory\ if\ (and\ only\ if)\ that\ directory\ exists\ and\ has\ a\ file\nnamed\ \"count\"\ in\ it,\ that\ gives\ the\ highest\ existing\ filename\ (e.g.\ dot.9\ if\ you\ save\ each\ individual\ dot\nspec\ into\ its\ own\ file).\ \ I\ seperated\ out\ each\ dot\ into\ its\ own\ file\ and\ put\ them\ there,\ to\ seed\ it,\ and\nnow\ it's\ easy\ to\ draw\ (using\ dot2dot.tcl)\ new\ drawings\ for\ the\ kiddies.\ \ It's\ somewhat\ unsafe\ in\ that\ the\nsave\ files\ get\ sourced,\ and\ thus\ could\ contain\ any\ tcl\ code,\ but\ it\ pleases\ the\ kids\ in\ my\ internal\ machine.\nQueries\ etc\ to\ [email protected],\ this\ being\ my\ first\ post\ to\ this\ wiki.\ I\ did\ it\ as\ a\ patch\ so\ people\ don't\ have\nto\ accept\ the\ changes,\ but\ feel\ free\ to\ just\ check\ it\ in\ (or\ make\ me\ check\ it\ in)\ over\ the\ original\ if\ desired.\n\n----\n\ ##+##########################################################################\n\ #\n\ #\ dot2dot.tcl\ -\ a\ simple\ dot-to-dot\ game\n\ #\ by\ Keith\ Vetter\n\ #\n\ #\ Revisions:\n\ #\ KPV\ Oct\ 20,\ 2002\ -\ initial\ revision\n\ #\ KPV\ Feb\ 28,\ 2003\ -\ added\ more\ puzzles,\ revamped\ gui,\ added\ sounds\n\ #\n\ \n\ package\ require\ Tk\n\ \n\ set\ S(r1)\ 5\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Dot\ size\n\ set\ S(r2)\ 10\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Dot\ size\ when\ it's\ next\n\ set\ S(build)\ 0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Build\ mode\n\ set\ S(which)\ -1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Which\ puzzle\ we're\ doing\n\ set\ S(out)\ 1\n\ set\ S(color)\ black\n\ set\ S(sound)\ 1\n\ set\ ddata(done)\ 0\n\ set\ xdots\ \{\}\n\ \n\ proc\ DoDisplay\ \{\}\ \{\n\ \ \ \ wm\ title\ .\ \"Dot\ 2\ Dot\"\n\ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\ -padx\ 5\ -pady\ 5\]\ \\\n\ \ \ \ \ \ \ \ -side\ right\ -fill\ both\ -ipady\ 5\n\ \ \ \ pack\ \[frame\ .top\ -relief\ raised\ -bd\ 2\]\ -side\ top\ -fill\ x\n\ \ \ \ pack\ \[frame\ .screen\ -bd\ 2\ -relief\ raised\]\ -side\ top\ -fill\ both\ -expand\ 1\n\ \ \ \ \n\ \ \ \ canvas\ .c\ -relief\ raised\ -borderwidth\ 0\ -height\ 600\ -width\ 700\ \\\n\ \ \ \ \ \ \ \ -highlightthickness\ 0\n\ \ \ \ .c\ xview\ moveto\ 0\ \;\ .c\ yview\ moveto\ 0\n\ \ \ \ pack\ .c\ -in\ .screen\ -side\ top\ -fill\ both\ -expand\ 1\n\ \n\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n\ \ \ \ lappend\ colors\ \[lindex\ \[.c\ config\ -bg\]\ 3\]\ black\n\ \ \ \ foreach\ color\ \$colors\ \{\n\ \ \ \ \ \ \ \ radiobutton\ .top.b\$color\ -width\ 1\ -padx\ 0\ -pady\ 0\ -bg\ \$color\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -variable\ S(color)\ -value\ \$color\ -command\ ReColor\n\ \ \ \ \ \ \ \ bind\ .top.b\$color\ <3>\ \[list\ .c\ config\ -bg\ \$color\]\n\ \ \ \ \}\n\ \ \ \ eval\ pack\ \[winfo\ children\ .top\]\ -side\ left\ -fill\ y\n\ \ \ \ \n\ \ \ \ focus\ .c\n\ \ \ \ pack\ .c\ -side\ left\ -fill\ both\ -expand\ 1\n\ \ \ \ bind\ .c\ <Motion>\ \[list\ MMove\ %x\ %y\]\n\ \ \ \ bind\ .c\ <Button-1>\ \{MDown\ %x\ %y\}\n\ \ \ \ bind\ .c\ <Button-3>\ \{M3Down\ %x\ %y\}\n\ \ \ \ bind\ .c\ <Leave>\ \{.c\ delete\ xline\}\n\ \ \ \ bind\ .c\ <Configure>\ \{ReCenter\ %W\ %h\ %w\}\n\ \ \ \ bind\ .c\ <Control-s>\ \{ConnectDot\ 1\}\n\ \ \ \ bind\ .c\ <Control-a>\ ConnectDot\n\ \ \ \ bind\ all\ <Alt-c>\ \{console\ show\}\n\ \n\ \ \ \ DoCtrlFrame\n\ \ \ \ return\n\ \}\n\ proc\ DoCtrlFrame\ \{\}\ \{\n\ \n\ \ \ \ option\ add\ *Button.borderWidth\ 4\ \n\ \ \ \ button\ .restart\ -text\ Restart\ -command\ \{DoDots\ -2\}\n\ \ \ \ button\ .next\ -text\ \"Next\ Puzzle\"\ -command\ \{DoDots\ -1\}\n\ \ \ \ button\ .random\ -text\ \"Random\ Puzzle\"\ -command\ \{DoDots\ -3\}\n\ \ \ \ frame\ .pf\ -bd\ \[.next\ cget\ -bd\]\ -relief\ raised\n\ \ \ \ label\ .pl\ -text\ \"\ Pick\ Puzzle\"\n\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \ \ \ \n\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\ -padx\ 5\ \n\ \ \ \ checkbutton\ .build\ -text\ \"Build\ Mode\"\ -variable\ S(build)\ -anchor\ w\ \\\n\ \ \ \ \ \ \ \ -command\ ToggleBuildMode\n\ \ \ \ button\ .done\ -text\ Done\ -command\ Done\n\ \ \ \ button\ .clear\ -text\ Clear\ -command\ Clear\n\ \ \ \ button\ .copy\ -text\ Copy\ -command\ Copy\n\ \ \ \ button\ .undo\ -text\ Undo\ -command\ \{M3Down\ -1\ -1\}\n\ \n\ \ \ \ checkbutton\ .sound\ -text\ \"Sounds\"\ -relief\ raised\ -bd\ \[.next\ cget\ -bd\]\ \\\n\ \ \ \ \ \ \ \ -variable\ S(sound)\ -padx\ 10\ -anchor\ w\n\ \ \ \ button\ .about\ -text\ About\ -command\ About\n\ \n\ \ \ \ grid\ .pf\ \ \ \ -in\ .ctrl\ -sticky\ ew\ -row\ 0\n\ \ \ \ pack\ .pl\ .p\ -in\ .pf\ -side\ left\n\ \ \ \ \n\ \ \ \ grid\ .next\ \ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .random\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .restart\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ grid\ .bframe\ -in\ .ctrl\ -sticky\ ew\ -row\ 11\n\ \ \ \ grid\ .sound\ -in\ .ctrl\ -sticky\ ew\ -row\ 51\n\ \ \ \ grid\ .about\ -in\ .ctrl\ -sticky\ ew\n\ \n\ \ \ \ place\ .build\ -in\ .bframe\ -relx\ .05\ -rely\ 0\ -anchor\ w\n\ \ \ \ grid\ .clear\ \ -in\ .bframe\ -sticky\ ew\ -row\ 2\n\ \ \ \ grid\ .copy\ \ \ -in\ .bframe\ -sticky\ ew\n\ \ \ \ grid\ .undo\ \ \ -in\ .bframe\ -sticky\ ew\n\ \ \ \ grid\ .done\ \ \ -in\ .bframe\ -sticky\ ew\n\ \n\ \ \ \ grid\ rowconfigure\ .ctrl\ 10\ -minsize\ 50\n\ \ \ \ grid\ rowconfigure\ .ctrl\ 50\ -weight\ 1\n\ \ \ \ grid\ rowconfigure\ .bframe\ 0\ -minsize\ 20\n\ \ \ \ grid\ rowconfigure\ .bframe\ 10\ -minsize\ 5\n\ \ \ \ grid\ columnconfigure\ .bframe\ 0\ -weight\ 1\n\ \n\ \ \ \ trace\ variable\ ::S(new)\ w\ PickPuzzle\n\ \ \ \ trace\ variable\ ::S(build)\ w\ TraceBuild\n\ \ \ \ trace\ variable\ ::xdots\ w\ TraceXDots\n\ \}\n\ proc\ ReColor\ \{\}\ \{\n\ \ \ \ global\ S\n\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n\ \ \ \ .c\ itemconfig\ dot\ -fill\ \$S(color)\ -outline\ \$S(color)\n\ \ \ \ .c\ itemconfig\ extra\ -fill\ \$S(color)\n\ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ \$S(color)\}\n\ \}\n\ proc\ TraceBuild\ \{var1\ var2\ op\}\ \{\n\ \ \ \ if\ \{\$::S(build)\}\ \{set\ s\ normal\}\ \{set\ s\ disabled\}\n\ \ \ \ foreach\ w\ \{.copy\ .undo\ .done\ .clear\}\ \{\n\ \ \ \ \ \ \ \ \$w\ config\ -state\ \$s\n\ \ \ \ \}\n\ \ \ \ TraceXDots\ x\ y\ z\n\ \}\n\ proc\ TraceXDots\ \{var1\ var2\ op\}\ \{\n\ \ \ \ if\ \{!\ \$::S(build)\}\ return\n\ \ \ \ set\ len\ \[llength\ \$::xdots\]\n\ \ \ \ array\ set\ s\ \{0\ disabled\ 1\ normal\}\n\ \ \ \ .undo\ config\ -state\ \$s(\[expr\ \{\$len\ >\ 0\}\])\n\ \ \ \ .done\ config\ -state\ \$s(\[expr\ \{\$len\ >=\ 6\}\])\n\ \}\n\ proc\ PickPuzzle\ \{arr\ val\ op\}\ \{\n\ \ \ \ global\ S\n\ \ \ \ if\ \{\$S(new)\ ==\ \$S(which)\}\ return\n\ \ \ \ DoDots\ \$S(new)\n\ \}\n\ proc\ ReCenter\ \{W\ h\ w\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ by\ <Configure>\ event\n\ \ \ \ set\ h\ \[expr\ \{\$h\ /\ 2.0\}\]\n\ \ \ \ set\ w\ \[expr\ \{\$w\ /\ 2.0\}\]\n\ \ \ \ \$W\ config\ -scrollregion\ \[list\ -\$w\ -\$h\ \$w\ \$h\]\n\ \}\n\ proc\ About\ \{\}\ \{\n\ \ \ \ tk_messageBox\ -title\ About\ -message\ \\\n\ \ \ \ \ \ \ \ \"Dot\ 2\ Dot\\nby\ Keith\ Vetter,\ February\ 2003\"\n\ \}\n\ proc\ DoDots\ \{which\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Install\ a\ new\ puzzle\n\ \ \ \ global\ dots\ ddata\ S\n\ \ \ \ \n\ \ \ \ if\ \{\$which\ ==\ -2\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Reuse\ last\ one\n\ \ \ \ \ \ \ \ set\ which\ \$S(which)\n\ \ \ \ \}\ elseif\ \{\$which\ ==\ -1\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Next\ one\n\ \ \ \ \ \ \ \ set\ names\ \[lsort\ -dictionary\ \[array\ names\ dots\]\]\n\ \ \ \ \ \ \ \ set\ n\ \[lsearch\ \$names\ \$S(which)\]\ \ \ \ \ \ \ \ \;#\ Find\ which\ one\ was\ last\n\ \ \ \ \ \ \ \ if\ \{\[incr\ n\]\ >=\ \[llength\ \$names\]\}\ \{set\ n\ 0\}\ \;#\ Wrap\n\ \ \ \ \ \ \ \ set\ which\ \[lindex\ \$names\ \$n\]\n\ \ \ \ \}\ elseif\ \{\$which\ ==\ -3\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Random\n\ \ \ \ \ \ \ \ set\ names\ \[array\ names\ dots\]\n\ \ \ \ \ \ \ \ set\ len\ \[llength\ \$names\]\n\ \ \ \ \ \ \ \ set\ n\ \[expr\ \{int(\$len\ *\ rand())\}\]\n\ \ \ \ \ \ \ \ set\ which\ \[lindex\ \$names\ \$n\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ set\ S(build)\ 0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Turn\ off\ build\ mode\n\ \ \ \ set\ S(which)\ \$which\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Remember\ which\ puzzle\n\ \ \ \ set\ S(new)\ \$which\n\ \ \ \ .c\ delete\ all\n\ \ \ \ catch\ \{unset\ ddata\}\n\ \ \ \ array\ set\ ddata\ \{done\ 0\ last\ 1\ next\ 2\ close\ 0\ xy\ \{\}\}\n\ \n\ \ \ \ set\ cnt\ 0\n\ \ \ \ foreach\ \{x\ y\}\ \$dots(\$which)\ \{\n\ \ \ \ \ \ \ \ if\ \{\$x\ ==\ 999\ &&\ \$y\ ==\ 999\}\ \{\ \ \ \ \ \ \ \ \ \ \ \;#\ Flag\ to\ connect\ to\ beginning\n\ \ \ \ \ \ \ \ \ \ \ \ set\ ddata(close)\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ break\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ incr\ cnt\n\ \ \ \ \ \ \ \ set\ ddata(\$cnt)\ \[list\ \$x\ \$y\]\n\ \ \ \ \ \ \ \ lappend\ ddata(xy)\ \$x\ \$y\n\ \ \ \ \ \ \ \ DrawOneDot\ \$cnt\n\ \ \ \ \}\n\ \ \ \ DoExtra\ \$which\n\ \ \ \ set\ ddata(end)\ \$cnt\n\ \ \ \ MakeTarget\n\ \}\n\ proc\ DrawOneDot\ \{n\}\ \{\n\ \ \ \ global\ ddata\ S\n\ \ \ \ foreach\ \{x\ y\}\ \$ddata(\$n)\ break\n\ \ \ \ set\ xy\ \[MakeBox\ \$x\ \$y\ \$S(r1)\]\n\ \ \ \ .c\ create\ oval\ \$xy\ -tag\ \[list\ dot\ d\$n\]\ -fill\ \$S(color)\ -outline\ \$S(color)\n\ \ \ \ set\ x\ \[expr\ \{\$x\ -\ 3\}\]\ \;\ set\ y\ \[expr\ \{\$y\ -\ 3\}\]\n\ \ \ \ .c\ create\ text\ \$x\ \$y\ -anchor\ se\ -text\ \$n\ -tag\ n\$n\n\ \ \ \ .c\ raise\ d\$n\ n\$n\n\ \}\n\ proc\ DoExtra\ \{which\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Draws\ extra\ lines\ on\ puzzle\n\ \ \ \ global\ extra\ ddata\n\ \n\ \ \ \ if\ \{!\ \[info\ exists\ extra(\$which)\]\}\ return\n\ \ \ \ set\ data\ \$extra(\$which)\n\ \ \ \ set\ len\ \[llength\ \$data\]\n\ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$len\}\ \{\}\ \{\n\ \ \ \ \ \ \ \ set\ what\ \[lindex\ \$data\ \$i\]\n\ \ \ \ \ \ \ \ set\ meta\ \[lindex\ \$data\ \[incr\ i\]\]\n\ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"c\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ foreach\ \{x\ y\}\ \[lrange\ \$data\ \$i\ \[expr\ \{\$i\ +\ 1\}\]\]\ break\n\ \ \ \ \ \ \ \ \ \ \ \ .c\ create\ oval\ \[MakeBox\ \$x\ \$y\ \$meta\]\ -width\ 5\ -tag\ extra\n\ \ \ \ \ \ \ \ \ \ \ \ incr\ i\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ continue\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"l\"\ ||\ \$what\ ==\ \"L\"\ ||\ \$what\ ==\ \"p\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"p\"\}\ \{set\ type\ polygon\}\ else\ \{set\ type\ line\}\n\ \ \ \ \ \ \ \ \ \ \ \ set\ last\ \[expr\ \{\$i\ +\ \$meta*2\ -\ 1\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ xy\ \[lrange\ \$data\ \$i\ \$last\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ n\ \[.c\ create\ \$type\ \$xy\ -width\ 3\ -tag\ extra\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ i\ \[expr\ \{\$last+1\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ ==\ \"L\"\}\ \{eval\ lappend\ ddata(xy)\ \$xy\}\n\ \ \ \ \ \ \ \ \ \ \ \ continue\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \}\n\ proc\ MakeBox\ \{x\ y\ d\}\ \{\n\ \ \ \ return\ \[list\ \[expr\ \{\$x-\$d\}\]\ \[expr\ \{\$y-\$d\}\]\ \[expr\ \{\$x+\$d\}\]\ \[expr\ \{\$y+\$d\}\]\]\n\ \}\n\ proc\ MMove\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ when\ mouse\ moves\n\ \ \ \ global\ ddata\ S\n\ \ \ \ if\ \{\$S(build)\ ==\ 1\ ||\ \$ddata(done)\}\ return\n\ \ \ \ .c\ delete\ xline\n\ \ \ \ set\ x\ \[.c\ canvasx\ \$x\]\ \;\ set\ y\ \[.c\ canvasy\ \$y\]\n\ \ \ \ .c\ create\ line\ \[concat\ \$ddata(\$ddata(last))\ \$x\ \$y\]\ -tag\ xline\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -fill\ \$S(color)\n\ \n\ \ \ \ if\ \{\[.c\ find\ withtag\ target\]\ ==\ \"\"\}\ return\n\ \ \ \ foreach\ \{x1\ y1\ x2\ y2\}\ \[.c\ bbox\ target\]\ break\ \;#\ Target\ for\ valid\ click\n\ \ \ \ if\ \{\$x\ <\ \$x1\ ||\ \$y\ <\ \$y1\ ||\ \$x\ >\ \$x2\ ||\ \$y\ >\ \$y2\}\ \{\n\ \ \ \ \ \ \ \ .c\ itemconfig\ target\ -fill\ green\ -outline\ green\n\ \ \ \ \ \ \ \ set\ S(out)\ 1\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ .c\ itemconfig\ target\ -fill\ red\ -outline\ red\n\ \ \ \ \ \ \ \ if\ \{\$S(out)\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ PlaySound\ enter\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ S(out)\ 0\n\ \ \ \ \}\ \ \ \ \n\ \}\n\ proc\ MDown\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Called\ on\ mouse\ click\n\ \ \ \ global\ ddata\ dots\ xdots\ S\n\ \n\ \ \ \ set\ x\ \[expr\ \{int(\[.c\ canvasx\ \$x\])\}\]\ \;\ set\ y\ \[expr\ \{int(\[.c\ canvasy\ \$y\])\}\]\n\ \ \ \ if\ \{\$S(build)\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Build\ dot2dot\ mode\n\ \ \ \ \ \ \ \ lappend\ xdots\ \$x\ \$y\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Add\ to\ our\ list\n\ \ \ \ \ \ \ \ set\ ddata(\[incr\ ddata(last)\])\ \[list\ \$x\ \$y\]\n\ \ \ \ \ \ \ \ DrawOneDot\ \$ddata(last)\n\ \ \ \ \ \ \ \ catch\ \{.c\ coords\ build\ \$xdots\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ if\ \{\$ddata(done)\}\ return\n\ \ \ \ foreach\ \{x1\ y1\ x2\ y2\}\ \[.c\ bbox\ target\]\ break\ \;#\ Target\ for\ valid\ click\n\ \ \ \ if\ \{\$x\ <\ \$x1\ ||\ \$y\ <\ \$y1\ ||\ \$x\ >\ \$x2\ ||\ \$y\ >\ \$y2\}\ return\n\ \ \ \ foreach\ a\ \[after\ info\]\ \{after\ cancel\ \$a\}\n\ \ \ \ PlaySound\ click\n\ \ \ \ ConnectDot\n\ \}\n\ proc\ M3Down\ \{x\ y\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Right-click\ ==\ undo\n\ \ \ \ global\ ddata\ dots\ xdots\ S\n\ \ \ \ if\ \{\$S(build)\ ==\ 0\}\ return\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Not\ in\ build\ mode\n\ \ \ \ if\ \{\$ddata(last)\ ==\ 0\}\ return\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Nothing\ to\ undo\n\ \ \ \ \n\ \ \ \ set\ xdots\ \[lrange\ \$xdots\ 0\ end-2\]\ \ \ \ \ \ \ \ \ \ \ \;#\ Remove\ last\ dot\n\ \ \ \ .c\ delete\ xline\ build\ d\$ddata(last)\ n\$ddata(last)\n\ \ \ \ .c\ create\ line\ -tag\ build\n\ \n\ \ \ \ incr\ ddata(last)\ -1\n\ \ \ \ if\ \{\$ddata(last)\ <=\ 0\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Completely\ empty\n\ \ \ \ \ \ \ \ set\ S(build)\ 1\n\ \ \ \ \ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ \}\ elseif\ \{\$ddata(last)\ >\ 1\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Some\ completed\ lines\n\ \ \ \ \ \ \ \ .c\ coords\ build\ \$xdots\n\ \ \ \ \}\n\ \ \ \ if\ \{\$x\ !=\ -1\}\ \{\ MMove\ \$x\ \$y\ \}\n\ \}\n\ proc\ ConnectDot\ \{\{all\ 0\}\}\ \{\n\ \ \ \ global\ ddata\ S\n\ \n\ \ \ \ .c\ delete\ xline\ target\n\ \ \ \ while\ \{1\}\ \{\n\ \ \ \ \ \ \ \ .c\ create\ line\ \[concat\ \$ddata(\$ddata(last))\ \$ddata(\$ddata(next))\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -fill\ black\ -width\ 3\ -tag\ line\ -fill\ \$S(color)\n\ \ \ \ \ \ \ \ incr\ ddata(last)\n\ \ \ \ \ \ \ \ incr\ ddata(next)\n\ \ \ \ \ \ \ \ if\ \{\$ddata(last)\ ==\ \$ddata(end)\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ DonePuzzle\n\ \ \ \ \ \ \ \ \ \ \ \ break\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ MakeTarget\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{!\ \$all\}\ break\n\ \ \ \ \}\n\ \}\n\ proc\ MakeTarget\ \{\}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Draws\ where\ next\ click\ goes\n\ \ \ \ global\ ddata\ S\n\ \ \ \ .c\ delete\ target\n\ \n\ \ \ \ foreach\ \{x\ y\}\ \$ddata(\$ddata(next))\ break\n\ \ \ \ set\ xy\ \[MakeBox\ \$x\ \$y\ \$S(r2)\]\n\ \ \ \ .c\ create\ oval\ \$xy\ -tag\ target\ -fill\ green\ -outline\ green\n\ \}\n\ proc\ DonePuzzle\ \{\}\ \{\n\ \ \ \ global\ ddata\ dots\n\ \ \ \ \n\ \ \ \ set\ ddata(done)\ 1\n\ \ \ \ if\ \{\$ddata(close)\}\ \{\n\ \ \ \ \ \ \ \ eval\ .c\ create\ line\ \$ddata(\$ddata(last))\ \$ddata(1)\ -fill\ black\ -width\ 3\n\ \ \ \ \}\n\ \ \ \ .c\ delete\ target\n\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ yellow\n\ \ \ \ .c\ lower\ done\n\ \n\ \ \ \ #\ Add\ to\ our\ pick\ puzzle\ widget\n\ \ \ \ destroy\ .p\n\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \ \ \ pack\ .p\ -in\ .pf\ -side\ right\n\ \}\n\ proc\ ToggleBuildMode\ \{\}\ \{\n\ \ \ \ if\ \{\$::S(build)\}\ \{\n\ \ \ \ \ \ \ \ GoBuildMode\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ set\ n\ \[Done\]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Finish\ off\ this\ build\n\ \ \ \ \ \ \ \ if\ \{!\ \$n\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ DoDots\ -2\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \}\n\ proc\ GoBuildMode\ \{\{ifile\ \"\"\}\}\ \{\n\ \ \ \ Clear\n\ \ \ \ set\ ::S(build)\ 1\n\ \n\ \ \ \ catch\ \{image\ delete\ d2d\}\n\ \ \ \ if\ \{\$ifile\ !=\ \"\"\}\ \{\n\ \ \ \ \ \ \ \ image\ create\ photo\ d2d\ -file\ \$ifile\n\ \ \ \ \ \ \ \ .c\ create\ image\ 0\ 0\ -anchor\ c\ -image\ d2d\ -tag\ image\n\ \ \ \ \ \ \ \ .c\ lower\ image\n\ \ \ \ \}\ \ \ \ \n\ \}\n\ proc\ Clear\ \{\{all\ 1\}\}\ \{\n\ \ \ \ global\ xdots\ ddata\n\ \ \ \ \n\ \ \ \ .c\ delete\ done\ target\ xline\n\ \ \ \ if\ \{\$all\}\ \{.c\ delete\ all\}\n\ \ \ \ catch\ \{unset\ ddata\}\n\ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ set\ ddata(done)\ 0\n\ \ \ \ set\ xdots\ \{\}\ \n\ \ \ \ .c\ create\ line\ -tag\ build\n\ \ \ \ catch\ \{image\ delete\ d2d\}\n\ \}\n\ proc\ Copy\ \{\}\ \{\n\ \ \ \ global\ dots\ ddata\ xdots\n\ \n\ \ \ \ regsub\ -all\ \{\\.0\}\ \$xdots\ \{\}\ xdots\n\ \ \ \ clipboard\ clear\n\ \ \ \ clipboard\ append\ \$xdots\n\ \ \ \ set\ len\ \[expr\ \{\[llength\ \$xdots\]\ /\ 2\}\]\n\ \ \ \ set\ ddata(last)\ 0\n\ \ \ \ set\ ddata(done)\ 0\n\ \ \ \ set\ xdots\ \{\}\n\ \}\n\ proc\ Done\ \{\}\ \{\n\ \ \ \ global\ dots\ extra\ xdots\n\ \ \ \ if\ \{\[llength\ \$xdots\]\ <=\ 3\}\ \{return\ 0\}\n\ \n\ \ \ \ for\ \{set\ cnt\ 1\}\ \{1\}\ \{incr\ cnt\}\ \{\n\ \ \ \ \ \ \ \ set\ name\ \"n\$cnt\"\n\ \ \ \ \ \ \ \ if\ \{!\ \[info\ exists\ dots(\$name)\]\}\ break\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ set\ dots(\$name)\ \$xdots\n\ \ \ \ lappend\ dots(\$name)\ 999\ 999\n\ \ \ \ set\ extra(\$name)\ \{\}\n\ \ \ \ Copy\n\ \ \ \ DoDots\ \$name\n\ \ \ \ return\ 1\n\ \}\n\ proc\ ScaleIt\ \{n\ s\}\ \{\n\ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ set\ d2\ \[set\ e2\ \{\}\]\n\ \ \ \ foreach\ \{x\ y\}\ \$dots(\$n)\ \{\n\ \ \ \ \ \ \ \ if\ \{\$x\ !=\ 999\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ set\ x\ \[expr\ \{round(\$x\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ y\ \[expr\ \{round(\$y\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ lappend\ d2\ \$x\ \$y\n\ \ \ \ \}\n\ \ \ \ foreach\ \{x\ y\}\ \$extra(\$n)\ \{\n\ \ \ \ \ \ \ \ if\ \{\[string\ is\ double\ \$x\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ set\ x\ \[expr\ \{round(\$x\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ set\ y\ \[expr\ \{round(\$y\ *\ \$s)\}\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ lappend\ e2\ \$x\ \$y\n\ \ \ \ \}\n\ \ \ \ set\ dots(\$n)\ \$d2\n\ \ \ \ set\ extra(\$n)\ \$e2\n\ \ \ \ DoDots\ \$n\n\ \ \ \ clipboard\ clear\n\ \ \ \ clipboard\ append\ \"set\ dots(\$n)\ \{\$d2\}\\n\"\n\ \ \ \ clipboard\ append\ \"set\ extra(\$n)\ \{\$e2\}\\n\"\n\ \}\n\ \n\ proc\ Shapes\ \{\}\ \{\n\ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ set\ dots(0)\ \{-286\ -8\ -242\ -18\ -217\ -37\ -191\ -66\ -176\ -89\ -173\ -133\ -146\n\ \ \ \ \ \ \ \ -132\ -103\ -106\ -51\ -134\ -2\ -147\ 56\ -156\ 136\ -156\ 222\ -132\ 248\ -137\n\ \ \ \ \ \ \ \ 288\ -177\ 297\ -176\ 293\ -147\ 280\ -119\ 298\ -95\ 298\ -69\ 309\ -32\ 310\ 29\n\ \ \ \ \ \ \ \ 270\ 110\ 233\ 223\ 177\ 231\ 157\ 156\ 80\ 152\ 0\ 152\ -54\ 231\ -104\ 231\ -107\n\ \ \ \ \ \ \ \ 135\ -174\ 115\ -227\ 88\ -284\ 38\ 999\ 999\}\n\ \ \ \ set\ extra(0)\ \{c\ 12\ -118\ -36\n\ \ \ \ \ \ \ \ l\ 5\ -129\ 127\ -116\ 122\ -93\ 110\ -78\ 92\ -65\ 67\n\ \ \ \ \ \ \ \ l\ 12\ 294\ -180\ 308\ -186\ 317\ -195\ 315\ -201\ 306\ -208\ 297\ -214\ 294\ -225\ 304\n\ \ \ \ \ \ \ \ -233\ 316\ -234\ 321\ -220\ 318\ -218\ 309\ -219\}\n\ \ \ \ set\ dots(1)\ \{34\ -114\ 57\ -133\ 90\ -145\ 145\ -139\ 208\ -91\ 224\ -30\ 221\ 45\ 196\ 117\n\ \ \ \ \ \ \ \ 129\ 199\ 59\ 241\ 26\ 235\ -7\ 228\ -45\ 239\ -110\ 207\ -163\ 149\ -191\ 66\ -197\ -19\n\ \ \ \ \ \ \ \ -161\ -90\ -112\ -131\ -45\ -138\ -6\ -108\ 999\ 999\}\n\ \ \ \ set\ extra(1)\ \{\n\ \ \ \ \ \ \ \ l\ 11\ -99\ -87\ -111\ -77\ -130\ -54\ -139\ -38\ -151\ -11\ -159\ 22\ -165\ -3\ -162\n\ \ \ \ \ \ \ \ \ \ \ \ \ -27\ -151\ -55\ -134\ -73\ -99\ -87\n\ \ \ \ \ \ \ \ p\ 20\ 36\ -233\ 26\ -217\ 20\ -202\ 15\ -182\ 14\ -160\ 18\ -124\ 23\ -99\ 20\ -92\ 16\n\ \ \ \ \ \ \ \ \ \ \ \ \ -80\ 8\ -77\ 5\ -96\ -2\ -119\ -7\ -152\ -8\ -173\ -5\ -203\ 0\ -231\ 11\ -253\ 16\n\ \ \ \ \ \ \ \ \ \ \ \ \ -241\ 26\ -232\ 36\ -233\n\ \ \ \ \ \ \ \ l\ 14\ 8\ -88\ -14\ -98\ -7\ -85\ -15\ -76\ -25\ -76\ -2\ -73\ 1\ -58\ 10\ -75\ 23\ -65\ 26\n\ \ \ \ \ \ \ \ \ \ \ \ \ -79\ 46\ -79\ 30\ -88\ 39\ -98\ 21\ -96\n\ \ \ \ \}\n\ \ \ \ set\ dots(2)\ \{-106\ -114\ -94\ -153\ -51\ -174\ -11\ -160\ 7\ -131\ 6\ -87\ -28\ -26\ 22\n\ \ \ \ \ \ \ \ -28\ 75\ -13\ 100\ -69\ 119\ 12\ 96\ 55\ 43\ 81\ -34\ 88\ -91\ 61\ -111\ 11\ -83\ -46\ -80\n\ \ \ \ \ \ \ \ -72\ -128\ -58\ -166\ -85\ 999\ 999\}\n\ \ \ \ set\ extra(2)\ \{\n\ \ \ \ \ \ \ \ p\ 6\ -75\ -124\ -72\ -119\ -74\ -111\ -77\ -109\ -82\ -116\ -81\ -123\n\ \ \ \ \ \ \ \ p\ 4\ -67\ -137\ -63\ -126\ -60\ -130\ -65\ -141\n\ \ \ \ \ \ \ \ l\ 7\ -144\ -70\ -133\ -71\ -119\ -71\ -108\ -76\ -98\ -87\ -102\ -90\ -96\ -86\n\ \ \ \ \ \ \ \ l\ 6\ -39\ 10\ -23\ 43\ 0\ 48\ 37\ 46\ 55\ 37\ 66\ 20\n\ \ \ \ \ \ \ \ l\ 4\ 8\ 26\ 29\ 29\ 44\ 26\ 55\ 21\n\ \ \ \ \ \ \ \ l\ 3\ 10\ 15\ 27\ 16\ 47\ 14\n\ \ \ \ \ \ \ \ l\ 18\ -107\ 62\ -122\ 68\ -131\ 79\ -126\ 86\ -115\ 90\ -98\ 96\ -71\ 101\ -36\ 103\ -6\n\ \ \ \ \ \ \ \ \ \ \ \ \ 105\ 35\ 105\ 70\ 103\ 97\ 99\ 132\ 93\ 151\ 86\ 160\ 82\ 162\ 78\ 156\ 75\ 137\ 72\n\ \ \ \ \ \ \ \ l\ 22\ -144\ 71\ -158\ 77\ -172\ 83\ -182\ 90\ -188\ 98\ -181\ 103\ -158\ 110\ -119\ 119\n\ \ \ \ \ \ \ \ \ \ \ \ \ -81\ 122\ -53\ 124\ -20\ 126\ -4\ 131\ 28\ 131\ 55\ 131\ 83\ 127\ 119\ 124\ 149\ 120\n\ \ \ \ \ \ \ \ \ \ \ \ \ 175\ 110\ 187\ 106\ 189\ 100\ 184\ 96\ 177\ 94\n\ \ \ \ \ \ \ \ l\ 16\ -146\ 134\ -138\ 138\ -126\ 140\ -115\ 143\ -95\ 143\ -62\ 146\ -42\ 144\ -30\ 146\n\ \ \ \ \ \ \ \ \ \ \ \ \ -13\ 150\ 20\ 151\ 53\ 153\ 100\ 150\ 117\ 149\ 155\ 148\ 169\ 144\ 171\ 137\n\ \ \ \ \ \ \ \ l\ 6\ -208\ -19\ -198\ -20\ -187\ -26\ -184\ -23\ -174\ -19\ -170\ -19\n\ \ \ \ \ \ \ \ l\ 5\ -182\ -14\ -169\ -18\ -153\ -25\ -149\ -23\ -132\ -21\n\ \ \ \ \ \ \ \ l\ 5\ -145\ -15\ -132\ -17\ -121\ -23\ -115\ -20\ -108\ -22\n\ \ \ \ \ \ \ \ l\ 17\ -159\ -225\ -151\ -222\ -127\ -224\ -110\ -224\ -96\ -222\ -80\ -221\ -72\ -227\n\ \ \ \ \ \ \ \ \ \ \ \ \ -55\ -227\ -45\ -230\ -60\ -232\ -75\ -232\ -85\ -236\ -102\ -237\ -117\ -237\n\ \ \ \ \ \ \ \ \ \ \ \ \ -127\ -234\ -148\ -232\ -159\ -225\n\ \ \ \ \}\n\ \ \ \ set\ dots(3)\ \{-231\ -76\ -211\ -95\ -188\ -78\ -162\ -110\ -116\ -119\ -69\ -138\ 14\ -130\n\ \ \ \ \ \ \ \ 3\ -158\ 45\ -155\ 37\ -187\ 81\ -184\ 69\ -201\ 111\ -212\ 113\ -247\ 152\ -225\ 171\n\ \ \ \ \ \ \ \ -259\ 175\ -223\ 199\ -208\ 233\ -152\ 235\ -126\ 221\ -116\ 155\ -144\ 127\ -68\ 131\n\ \ \ \ \ \ \ \ -37\ 115\ -6\ 138\ 70\ 120\ 93\ 125\ 165\ 138\ 190\ 132\ 207\ 151\ 222\ 160\ 240\ 127\ 240\n\ \ \ \ \ \ \ \ 119\ 221\ 107\ 204\ 91\ 108\ 62\ 116\ 37\ 125\ 9\ 139\ -17\ 123\ 8\ 97\ 24\ 109\ 51\ 103\ 80\n\ \ \ \ \ \ \ \ 84\ 52\ 31\ 38\ 3\ -17\ -21\ -40\ -17\ -81\ 27\ -100\ 57\ -93\ 132\ -83\ 158\ -87\ 176\n\ \ \ \ \ \ \ \ -59\ 194\ -49\ 210\ -93\ 211\ -100\ 186\ -114\ 173\ -116\ 142\ -129\ 66\ -134\ 25\n\ \ \ \ \ \ \ \ -104\ -17\ -122\ -67\ -113\ -103\ -137\ -85\ -187\ -38\ -208\ -44\ -225\ -60\ 999\ 999\}\n\ \ \ \ set\ extra(3)\ \{l\ 4\ 169\ -243\ 163\ -230\ 163\ -225\ 160\ -220\n\ \ \ \ \ \ \ \ l\ 4\ 156\ -143\ 148\ -146\ 143\ -154\ 139\ -165\n\ \ \ \ \ \ \ \ l\ 7\ 153\ -227\ 140\ -220\ 127\ -208\ 107\ -188\ 85\ -156\ 68\ -144\ 15\ -128\n\ \ \ \ \ \ \ \ l\ 7\ 192\ -181\ 191\ -193\ 185\ -197\ 176\ -195\ 169\ -189\ 175\ -182\ 192\ -181\n\ \ \ \ \ \ \ \ l\ 3\ -47\ -71\ -45\ -51\ -33\ -30\n\ \ \ \ \ \ \ \ l\ 9\ 104\ -29\ 103\ -21\ 98\ -14\ 91\ -4\ 92\ 10\ 97\ 20\ 100\ 47\ 102\ 63\ 116\ 96\n\ \ \ \ \}\n\ \ \ \ set\ dots(4)\ \{\n\ \ \ \ \ \ \ \ -257\ -39\ -239\ -90\ -205\ -130\ -149\ -154\ -87\ -155\ -25\ -145\ 17\ -121\ -6\ -156\n\ \ \ \ \ \ \ \ -23\ -203\ 14\ -201\ 46\ -195\ 41\ -220\ 95\ -199\ 134\ -161\ 152\ -113\ 195\ -86\ 223\n\ \ \ \ \ \ \ \ -65\ 244\ -38\ 266\ -9\ 260\ 17\ 237\ 38\ 205\ 55\ 168\ 58\ 122\ 48\ 144\ 96\ 195\ 103\ 226\n\ \ \ \ \ \ \ \ 115\ 224\ 149\ 205\ 173\ 182\ 180\ 152\ 177\ 110\ 161\ 63\ 136\ 37\ 98\ -15\ 97\ -54\ 90\n\ \ \ \ \ \ \ \ -83\ 74\ -104\ 100\ -127\ 115\ -129\ 134\ -79\ 131\ -30\ 130\ 12\ 140\ 27\ 174\ 4\ 179\n\ \ \ \ \ \ \ \ 29\ 205\ -31\ 221\ -101\ 223\ -176\ 222\ -227\ 218\ -263\ 207\ -262\ 175\ -212\ 115\n\ \ \ \ \ \ \ \ -244\ 91\ -259\ 63\}\n\ \ \ \ set\ extra(4)\ \{l\ 6\ 122\ 47\ 107\ 76\ 121\ 104\ 156\ 119\ 199\ 122\ 223\ 148\n\ \ \ \ \ \ \ \ l\ 7\ -132\ -36\ -104\ -23\ -86\ -3\ -76\ 21\ -73\ 44\ -77\ 60\ -83\ 73\n\ \ \ \ \ \ \ \ l\ 11\ -128\ 115\ -147\ 118\ -165\ 126\ -177\ 141\ -180\ 159\ -167\ 167\ -138\ 174\n\ \ \ \ \ \ \ \ -97\ 174\ -55\ 174\ -28\ 173\ 3\ 177\n\ \ \ \ \ \ \ \ c\ 2\ 193\ -34\ c\ 5\ 193\ -34\ c\ 8\ 193\ -34\n\ \ \ \ \ \ \ \ l\ 4\ 18\ -122\ 40\ -106\ 61\ -95\ 95\ -88\n\ \ \ \ \ \ \ \ l\ 8\ -24\ -204\ -5\ -184\ 20\ -164\ 52\ -140\ 86\ -120\ 111\ -108\ 122\ -105\ 127\ -99\n\ \ \ \ \ \ \ \ l\ 7\ 47\ -196\ 62\ -185\ 79\ -175\ 93\ -162\ 108\ -146\ 123\ -128\ 140\ -104\n\ \ \ \ \ \ \ \ l\ 5\ 263\ 17\ 254\ 20\ 247\ 20\ 242\ 15\ 241\ 7\n\ \ \ \ \ \ \ \ l\ 7\ 265\ -11\ 257\ -19\ 249\ -11\ 248\ -1\ 253\ 7\ 261\ 6\ 265\ -8\n\ \ \ \ \ \ \ \ L\ 27\ -259\ 63\ -266\ 69\ -275\ 65\ -282\ 58\ -275\ 48\ -281\ 48\ -289\ 46\ -282\ 40\n\ \ \ \ \ \ \ \ \ \ \ \ \ -291\ 36\ -295\ 31\ -289\ 21\ -300\ 18\ -298\ 11\ -293\ 7\ -297\ 1\ -294\ -2\ -289\n\ \ \ \ \ \ \ \ \ \ \ \ \ -6\ -297\ -15\ -293\ -21\ -289\ -25\ -296\ -32\ -293\ -39\ -280\ -42\ -279\n\ \ \ \ \ \ \ \ \ \ \ \ -47\ -271\ -54\ -263\ -49\ -257\ -39\}\n\ \ \ \ set\ dots(5)\ \{84\ -133\ 72\ -93\ 77\ -51\ 110\ -6\ 104\ 38\ 86\ 77\ 115\ 129\ 123\ 205\ 88\n\ \ \ \ \ \ \ \ 266\ 20\ 289\ -38\ 275\ -86\ 257\ -128\ 209\ -130\ 136\ -115\ 99\ -87\ 62\ -102\ 23\n\ \ \ \ \ \ \ \ -107\ -21\ -68\ -66\ -75\ -118\ -75\ -144\ -110\ -150\ -62\ -188\ -93\ -242\ -42\ -262\n\ \ \ \ \ \ \ \ 56\ -266\ 68\ -198\ 115\ -167\ 72\ -161\ 999\ 999\}\n\ \ \ \ set\ extra(5)\ \{\n\ \ \ \ \ \ \ \ l\ 8\ -87\ 61\ -70\ 80\ -50\ 94\ -19\ 104\ 11\ 104\ 41\ 101\ 67\ 92\ 86\ 77\n\ \ \ \ \ \ \ \ l\ 5\ -59\ -59\ -40\ -45\ -6\ -28\ 33\ -27\ 59\ -38\ 75\ -52\n\ \ \ \ \ \ \ \ p\ 8\ -34\ -59\ -12\ -49\ 15\ -45\ 41\ -49\ 50\ -63\ 34\ -59\ 14\ -55\ -5\ -56\n\ \ \ \ \ \ \ \ p\ 9\ -38\ -175\ -5\ -171\ 28\ -176\ 45\ -177\ 59\ -185\ 56\ -190\ 39\ -185\ 11\ -186\n\ \ \ \ \ \ \ \ \ \ \ \ -18\ -177\n\ \ \ \ \ \ \ \ p\ 9\ -7\ -113\ -19\ -117\ -11\ -131\ 3\ -129\ 9\ -119\ 10\ -106\ -1\ -96\ -13\ -97\n\ \ \ \ \ \ \ \ \ \ \ \ -18\ -106\n\ \ \ \ \ \ \ \ p\ 9\ 48\ -118\ 36\ -121\ 42\ -133\ 55\ -134\ 62\ -123\ 60\ -113\ 55\ -104\ 42\ -102\n\ \ \ \ \ \ \ \ \ \ \ \ 36\ -110\n\ \ \ \ \ \ \ \ p\ 14\ 108\ 5\ 210\ 34\ 231\ 27\ 242\ 25\ 243\ 34\ 230\ 41\ 239\ 46\ 258\ 50\ 253\ 59\ 215\n\ \ \ \ \ \ \ \ \ \ \ \ \ 54\ 219\ 64\ 213\ 69\ 173\ 39\ 105\ 17\n\ \ \ \ \ \ \ \ p\ 15\ -106\ -12\ -138\ -9\ -154\ -12\ -170\ -6\ -177\ -6\ -229\ -29\ -235\ -20\ -212\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -5\ -250\ 1\ -250\ 9\ -230\ 12\ -238\ 23\ -230\ 31\ -207\ 10\ -104\ 4\n\ \ \ \ \ \ \ \ l\ 8\ 60\ -79\ 30\ -104\ 16\ -100\ 7\ -88\ 9\ -74\ 14\ -68\ 29\ -68\ 60\ -79\}\n\ \ \ \ set\ dots(6)\ \{-10\ 145\ -57\ 165\ -94\ 150\ -116\ 121\ -112\ 80\ -75\ 54\ -31\ 59\ -86\ -3\n\ \ \ \ \ \ \ \ -106\ -69\ -92\ -131\ -54\ -155\ -20\ -115\ 3\ -162\ 48\ -182\ 82\ -212\ 124\ -219\ 153\n\ \ \ \ \ \ \ \ -199\ 164\ -162\ 164\ -115\ 155\ -42\ 132\ 13\ 145\ 35\ 138\ 60\ 117\ 77\ 112\ 101\ 94\n\ \ \ \ \ \ \ \ 120\ 57\ 129\ 50\ 148\ 66\ 203\ 113\ 189\ 121\ 198\ 64\ 231\ 54\ 209\ 38\ 154\ 15\ 154\n\ \ \ \ \ \ \ \ -29\ 205\ -29\ 226\ -92\ 195\ -83\ 182\ -42\ 203\ 4\ 151\ 1\ 102\ 999\ 999\}\n\ \ \ \ set\ extra(6)\ \{\n\ \ \ \ \ \ \ \ c\ 2\ -40\ 104\ c\ 2\ -77\ 89\n\ \ \ \ \ \ \ \ l\ 6\ -33\ 124\ -45\ 140\ -63\ 142\ -88\ 130\ -95\ 119\ -93\ 107\n\ \ \ \ \ \ \ \ l\ 4\ -55\ 123\ -57\ 115\ -66\ 111\ -76\ 116\n\ \ \ \ \ \ \ \ l\ 11\ 0\ 100\ -4\ 84\ -13\ 71\ -32\ 57\ -26\ 61\ -13\ 46\ 0\ 38\ 8\ 37\ 25\ 40\ 21\ 64\ 23\ 90\n\ \ \ \ \ \ \ \ l\ 23\ 48\ -183\ 42\ -172\ 36\ -158\ 33\ -143\ 34\ -129\ 37\ -121\ 28\ -126\ 14\ -129\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ \ -126\ -8\ -118\ -17\ -109\ -21\ -93\ -22\ -73\ -18\ -56\ -12\ -38\ 1\ -7\ 13\ 13\n\ \ \ \ \ \ \ \ \ \ \ \ \ 6\ 26\ 8\ 37\ 5\ 25\ 13\ 12\ 30\ 35\ 24\ 40\n\ \ \ \ \ \ \ \ l\ 7\ 28\ 101\ 44\ 100\ 61\ 91\ 87\ 76\ 105\ 56\ 122\ 34\ 133\ 13\n\ \ \ \ \ \ \ \ l\ 4\ 56\ 128\ 59\ 117\ 62\ 105\ 60\ 90\n\ \ \ \ \ \ \ \ l\ 3\ 118\ 76\ 113\ 69\ 103\ 58\n\ \ \ \ \}\n\ \ \ \ set\ dots(7)\ \{-6\ -15\ 18\ 0\ 88\ -4\ 96\ 100\ 156\ 165\ 108\ 219\ 135\ 172\ 72\ 109\ 79\ 20\n\ \ \ \ \ \ \ \ 18\ 23\ -17\ 3\ -19\ 43\ 43\ 137\ 6\ 212\ 24\ 137\ -35\ 53\ -34\ 2\ -77\ 58\ -58\ 99\ -118\n\ \ \ \ \ \ \ \ 162\ -88\ 227\ -142\ 165\ -81\ 96\ -101\ 45\ -51\ -11\ -124\ 41\ -110\ 80\ -155\ 99\ -131\n\ \ \ \ \ \ \ \ 77\ -135\ 26\ -69\ -28\ -143\ -36\ -134\ -150\ -144\ -204\ -111\ -157\ -124\ -47\ -84\n\ \ \ \ \ \ \ \ -46\ -99\ -141\ -58\ -224\ -84\ -146\ -69\ -60\ -52\ -75\ -59\ -137\ -28\ -192\ 38\ -194\n\ \ \ \ \ \ \ \ 89\ -162\ 87\ -99\ 40\ -50\ 999\ 999\}\n\ \ \ \ set\ extra(7)\ \{\n\ \ \ \ \ \ \ \ l\ 10\ 62\ -94\ 56\ -87\ 42\ -84\ 32\ -92\ 22\ -97\ 11\ -97\ -1\ -92\ -10\ -96\ -12\ -105\n\ \ \ \ \ \ \ \ \ \ \ \ \ -6\ -110\n\ \ \ \ \ \ \ \ c\ 5\ 6\ -140\ c\ 5\ 56\ -115\n\ \ \ \ \}\n\ \ \ \ set\ dots(8)\ \{-97\ -46\ -126\ 46\ -91\ 111\ -95\ 231\ -129\ 267\ -84\ 267\ -66\ 253\ -57\n\ \ \ \ \ \ \ \ 151\ -34\ 210\ -4\ 234\ -48\ 267\ 95\ 267\ 108\ 249\ 151\ 244\ 172\ 207\ 176\ 134\ 200\n\ \ \ \ \ \ \ \ 36\ 190\ -20\ 162\ -69\ 127\ -31\ 108\ 13\ 141\ 105\ 139\ 161\ 81\ 22\ 13\ -97\ 45\ -95\n\ \ \ \ \ \ \ \ 36\ -130\ 1\ -160\ -13\ -192\ -50\ -218\ -70\ -252\ -85\ -244\ -80\ -207\}\n\ \ \ \ set\ extra(8)\ \{l\ 7\ -29\ 192\ -31\ 169\ -22\ 153\ -10\ 136\ 14\ 129\ 31\ 130\ 45\ 136\n\ \ \ \ \ \ \ \ p\ 4\ -4\ -137\ 3\ -118\ 32\ -106\ 18\ -129\ c\ 3\ -39\ -171\n\ \ \ \ \ \ \ \ L\ 9\ -80\ -207\ -99\ -238\ -112\ -239\ -112\ -220\ -108\ -196\ -109\ -175\ -109\ -150\n\ \ \ \ \ \ \ \ \ \ \ \ -108\ -113\ -97\ -46\}\n\ \ \ \ set\ dots(9)\ \{-72\ 102\ -98\ 161\ -107\ 207\ -122\ 219\ -122\ 236\ -81\ 240\ -47\ 227\n\ \ \ \ \ \ \ \ -53\ 189\ -30\ 147\ -3\ 206\ -21\ 237\ 10\ 255\ 39\ 254\ 51\ 234\ 46\ 162\ 36\ 111\n\ \ \ \ \ \ \ \ 94\ 129\ 76\ 191\ 67\ 212\ 108\ 227\ 129\ 206\ 139\ 162\ 157\ 134\ 213\ 177\ 199\ 218\n\ \ \ \ \ \ \ \ 234\ 230\ 265\ 218\ 252\ 150\ 211\ 105\ 232\ 24\ 187\ -37\ 139\ -69\ 91\ -72\ 85\ -96\n\ \ \ \ \ \ \ \ 39\ -108\ -3\ -108\ -42\ -133\ -126\ -127\ -164\ -148\ -179\ -184\ -164\ -201\ -144\n\ \ \ \ \ \ \ \ -199\ -134\ -183\ -125\ -201\ -138\ -222\ -167\ -226\ -191\ -213\ -204\ -180\ -197\n\ \ \ \ \ \ \ \ -145\ -183\ -123\ -171\ -103\ -155\ -84\ -185\ -75\ -122\ -45\ -99\ -33\ -68\ 6\ -71\ 78\n\ \ \ \ \ \ \ \ 999\ 999\}\n\ \ \ \ set\ extra(9)\ \{c\ 10\ -95\ -108\n\ \ \ \ \ \ \ \ l\ 12\ -75\ -95\ -32\ -104\ 6\ -98\ 18\ -83\ 23\ -70\ 22\ -54\ 4\ -36\ -16\ -20\ -35\ -11\n\ \ \ \ \ \ \ \ -56\ -11\ -67\ -20\ -76\ -40\}\n\ \ \ \ set\ dots(10)\ \{-268\ -8\ -272\ -39\ -244\ -80\ -177\ -120\ -121\ -132\ -70\ -196\ -33\n\ \ \ \ \ \ \ \ -224\ 13\ -220\ -14\ -176\ -25\ -120\ 41\ -98\ 107\ -42\ 161\ 34\ 183\ 84\ 208\ 94\ 262\n\ \ \ \ \ \ \ \ 93\ 293\ 113\ 281\ 126\ 226\ 150\ 202\ 186\ 191\ 218\ 163\ 198\ 155\ 168\ 158\ 120\ 117\n\ \ \ \ \ \ \ \ 73\ 49\ 29\ -2\ 12\ -49\ 8\ -53\ 41\ -16\ 83\ -62\ 88\ -80\ 83\ -110\ 57\ -152\ 29\ -207\n\ \ \ \ \ \ \ \ 39\ -239\ 31\}\n\ \ \ \ set\ extra(10)\ \{\n\ \ \ \ \ \ \ \ l\ 5\ -146\ 22\ -133\ 22\ -124\ 18\ -115\ 18\ -96\ 15\n\ \ \ \ \ \ \ \ L\ 7\ -239\ 33\ -300\ 68\ -313\ 67\ -319\ 52\ -312\ 42\ -268\ 0\ -267\ -9\n\ \ \ \ \ \ \ \ l\ 3\ -239\ 29\ -224\ -4\ -267\ -4\n\ \ \ \ \ \ \ \ l\ 5\ -257\ 18\ -256\ 23\ -260\ 33\ -272\ 43\ -287\ 59\n\ \ \ \ \ \ \ \ l\ 4\ -222\ -28\ -212\ -43\ -203\ -48\ -195\ -49\n\ \ \ \ \ \ \ \ l\ 6\ -219\ -37\ -218\ -27\ -207\ -25\ -204\ -32\ -208\ -40\ -219\ -37\n\ \ \ \ \ \ \ \ c\ 2\ -212\ -30\n\ \ \ \ \ \ \ \ l\ 6\ -205\ -93\ -212\ -89\ -211\ -81\ -200\ -84\ -191\ -93\ -201\ -97\n\ \ \ \ \ \ \ \ l\ 17\ -139\ -42\ -117\ -47\ -67\ -46\ -33\ -43\ 14\ -33\ 47\ -17\ 81\ 8\ 119\ 41\ 153\ 76\n\ \ \ \ \ \ \ \ \ \ \ \ \ 176\ 108\ 185\ 124\ 201\ 135\ 214\ 142\ 220\ 141\ 211\ 130\ 204\ 118\ 197\ 114\n\ \ \ \ \}\n\ \}\n\ proc\ DoSounds\ \{\}\ \{\n\ \ \ \ set\ ::S(sound)\ 0\n\ \ \ \ .sound\ config\ -state\ disabled\n\ \n\ \ \ \ if\ \{\[catch\ \{package\ require\ base64\}\]\}\ return\n\ \ \ \ if\ \{\[catch\ \{package\ require\ snack\}\]\}\ return\n\ \n\ \ \ \ .sound\ config\ -state\ normal\n\ \ \ \ foreach\ e\ \{snd_click\ snd_enter\}\ \{\n\ \ \ \ \ \ \ \ sound\ \$e\n\ \ \ \ \ \ \ \ regsub\ -all\ \{\ \}\ \[set\ ::\$e\]\ \{\}\ b64data\n\ \ \ \ \ \ \ \ \$e\ data\ \[::base64::decode\ \$b64data\]\n\ \ \ \ \}\n\ \ \ \ set\ ::S(sound)\ 1\n\ \}\n\ proc\ PlaySound\ \{what\}\ \{\n\ \ \ \ if\ \{!\ \$::S(sound)\}\ return\n\ \ \ \ set\ snd\ \"snd_\$what\"\n\ \ \ \ if\ \{\[info\ commands\ \$snd\]\ ==\ \"\"\}\ return\n\ \ \ \ after\ 1\ \[list\ \$snd\ play\ -blocking\ 0\]\n\ \}\n\ set\ snd_click\ \{\n\ \ \ \ UklGRrEHAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YY0HAAB/f39/gICAgICAgICA\n\ \ \ \ f39/fn9/f4CAgICAf3+AgICBgYGBf359fX5/gIGChISEgX14dXZ6f4OFiIuMiYB2bm52foSHio+S\n\ \ \ \ k4x+bWBXY3mHjY2NlZqSg3NtcXp6eHd5goqLiY6Nf2tqeIKLnLGrhmJCOWF8h4+xvJJ3WTJTeX6E\n\ \ \ \ ja+/mH1qUE5lfoKIlsK6h3tbL2l/go28xIR9Qz15gIq9w31+Qjp2f4a0y4yBbkM9b3mDls6zgnY3\n\ \ \ \ Q3d5goWSp8yxjoF4VRlVc3iHvdGGhVYlWnt6o9irf4NAKmh2fpnYuYOLRytleX2w2KKGg0cpYnZ9\n\ \ \ \ sdaiiXc7Qmx0jsbAknUvT32Dw7uhhXo+NGF1g7LPpoqEWj9GYXV+jK3gq4+FVihab3uJv9OWjXdE\n\ \ \ \ MmJxjqGsr4xqXm96iH1zflphcoqyv4xvaVNpiZSAf4qCgIiloJh+TFRja259nbiphnxnbGJfdpKX\n\ \ \ \ maKPbl1fX26JnKOYe3BiaXqMinyHgn18fYeAe29xiot2fYiIi4h7dn+Fl6eMamNmcYGFg5Gbjn56\n\ \ \ \ cHVzdYWXnpB+bmhgdIibqqWHbFpUYnGHm6igjXlrX1hohJWkjnd2e397en1/b2NufYKSoqqUe2hb\n\ \ \ \ VVtte5KjpKKhgmFaZ3B3f5GclYp/gnxyamdwgIyapaGOgXFdaHeBhYN9h5eMjImBfm1pfIJ/g46W\n\ \ \ \ iXx1cm92gYeKkZeNf3h7fGhbaHmAkamqnIt1X09Vb3+PoqSQhXFcYXGAhI+moYp2alZRbIKLm62t\n\ \ \ \ mHtkTk9hc4KVpKmehHBlXmh4hI6TlpOMdmpnaHOBi5OUjoRwcG5tfIWLj5GPgXl8fXyChICDeWpt\n\ \ \ \ d3qCiYyLjI2BfYJ9d3d3fIB/h4h+enh+g4OHhoKAeXV5gIOCgoOAfHd7gYeNj4+LgXNsam12foOM\n\ \ \ \ jYqLhoB+eXqDhYeMhHVtam55h4yNjYd/fH18fH6AgYGCgoWJhnxxbnR8g4uQjIN7eXt5e36AgYGE\n\ \ \ \ h4N8eXp+goSEg358e3l7gIGEh4WDgHl3eHqAhYeIhoJ7dnV3fYKEhoWDgHt8gYSGhX95dXV3fYSJ\n\ \ \ \ iYWDfXl6e31+gYSEg4SCfXp4d3Z5gYmNjIh+c3F0e4OHiYuKhX56eHh5fYGDg4F/fn1/hYaDgX16\n\ \ \ \ eHl9gIOFh4mGgHx6d3Z6gYaJiIWCfXl4eXyBhIOBfn+Cg4SFg396dHJ0eoOLjouFgH57e36AgH58\n\ \ \ \ enp7fYCFioiFgX17ent9fH+Cg4F/fn+Af3+AgYODg4OBfnt4d3l8foGFiYmGg4F/e3h2d3uAhIaH\n\ \ \ \ hYJ+e3t+gIGChIOAfXp5eXt+gIOFhoOCg4F+fX19fXx8fX6AgYKDgX9/goOCgH58e3l5fICDhYaF\n\ \ \ \ g4B9fn9+fXx8fH6AgoSFhYKAfnp6e35/gYKDgoB/f3+AgIGCgICAgIGBfnp4eHyAhouNi4V8c29x\n\ \ \ \ eYGIjY2Gfnh1eHyBg4ODg4F+fX5+fXt7fYCEiImGgXx2dHd9g4eIh4WBfXp5e36ChoaDf3p4eXx+\n\ \ \ \ gYWGhYKAfXp7fH6Ag4SDf318fH1+gYSEgoB9fH1/goODgYB9e3t8gISIiIaAenZ2eX2Ch4qIhYB6\n\ \ \ \ d3h6foGFh4aDgH17ent9f4GCg4OCgX9+fX19fXx9gIKEhYSBfnt6enx/g4SDgYB/fn59fX1+gIGB\n\ \ \ \ goOCf3x7fH1/gYODgH9/f39/gYGAf318e31/goOEhIJ/fHp6fYCDhYWDf3x6e32Ag4WFhIF+fHt8\n\ \ \ \ fX+AgYOEhIF/fHp6fYGEhYWDf3t6e32Ag4aGg397enp7foCCg4OCgH9+fn5+f4CBgYGAf359fX5+\n\ \ \ \ foGDhIWFgn57eHh6foKFhoSAfHp6fICEh4eDfnp4eHt/goSFhIF+fHx9gIKDgoF/fXx8fn+BgoKC\n\ \ \ \ gYCAf359foCAgYB/fn9/f4CBgYB+fn+AgYKCgX99fX1+gIGCgoGAfn18fX5/gYOEg4F+fHt7fX+C\n\ \ \ \ g4OCgH58fHx+gIOEhIOBfnx7e31/gYOEhIKAfXx8fn+AgYGAf35+f3+BgoKBgH99fX5/gIGBgYB/\n\ \ \ \ fn1+f4GDg4OAfnx8fH6AgoODgX59fX5/gYGBgIB/f3+AgYGBgH9+fn5/f4CAgICAgH9+fX5+gIGC\n\ \ \ \ goF/fn19fX+AgoKCgYB/fn19foCBgoKAf359fn5/gIGBgIB/f39+fn5+f4CBgoKBgH9+fX1+gIGB\n\ \ \ \ gYGAgH9/fn9/f39/f3+AgICAgICAgIB/f39/f4CAgICAgICAgYCAf35+f39/gIGAgH9+fn5/gIGC\n\ \ \ \ goB/fn1+fn+AgYGAf39/f3+AgICAgIB/f39/f3+AgICAgICAgH9/fn5/f4CAgIB/f39/gICAgIB/\n\ \ \ \ f35+fn9/gIGBgIB/f39/f39/f39/f39/f4CBgYGBgH9+fX1+gIGCgoGAfn5+fn+AgYGAf35+fn5/\n\ \ \ \ gIGBgYB/f35+f3+AgICAf39/f3+AgICAgH9/f39/gICAf39/f3+AgICAgICAf39/f3+AgICAgICA\n\ \ \ \ f39/f39/gICAgIB/f4CAgH9/f39/f3+AgICAgICAf39/f4CAgICA\n\ \}\n\ set\ snd_enter\ \{\n\ \ \ \ UklGRkACAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YRwCAACA\n\ \ \ \ gId0ZHZbU5aMj7/MsIZ6UX6nWIiITWiIRUGUlZesvrGCiKiKTl96Fit3YF5e\n\ \ \ \ mrGHqcqhlJuAdWxgW01EbWSHubW1uJ2MkqGPYFVSamtvgHmEh5ybraWLkHp5\n\ \ \ \ Xm5oWGRvb3WSlYqMi4+JhY6Ac25xdXp5jYR/hoODdIN8e356goCHgoqGgIV/\n\ \ \ \ g35/d3N2eHZ6gIOIgouHioaNioGAfHpycHp2dH2HiouNiYiKhIF9enZzd3l+\n\ \ \ \ dX2BgYKIjoaJhIJ/fX6AfHl8fICAgICEgISFhYF/gH+AfIJ/gH6AfX6AfICA\n\ \ \ \ fYB+gn2DfoGAgIOAgYB8e3x9gIKChYCDgIN/g32Afn+BgIF+gH+BgIOAgX2C\n\ \ \ \ fYGAgIB/gH9/fIB/gICBgH+Df4KAgIB9gHuBfYKAgoCAhICDgIN+gH+Af4CA\n\ \ \ \ gIGAg4CFgIOAgICAgH9/f32AfoF/gn+BgICAf4B/gICAgICAgIKAgYCAgH+A\n\ \ \ \ fYB8f4CAgoGBgIKBgHt0cnqEi4yIhoKHioOBeoF+gHRvbW10eYSHhoyMmI+P\n\ \ \ \ hIF5dm9tbW92fICJjpKRkY6JhHx5b2xlbnWAhYeOjpSQkIiAe3R1cnNzdnx/\n\ \ \ \ gomLj4yJhICAfHp3d3d6fYKDhoKGgIeAhX1/eXt9foCAg4GCg4CDfYF6gHmA\n\ \ \ \ fYCBgIR/h4CEf4B9fn98gHuEfYV/g4CAgn6Fe4R6gn1/gHuDe4V+g4CAgn8=\n\ \}\n\ \n\ ################################################################\n\ Shapes\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Load\ all\ our\ dot2dot\ shapes\n\ DoDisplay\n\ DoSounds\n\ DoDots\ -3\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Pick\ and\ show\ a\ puzzle\ \n\n----\nif\ \{0\}\ \{\n#\ patch\ code\ here,\ save\ and\ run\ as\ 'patch\ <file'.\n---\ dot2dot.tcl\ 2003-11-18\ 11:07:45.000000000\ -0500\n+++\ dot2dotv2.tcl\ \ \ \ \ \ \ 2003-11-18\ 11:07:53.000000000\ -0500\n@@\ -1,3\ +1,7\ @@\n+#!/bin/sh\n+#\ the\ next\ line\ restarts\ using\ wish\ \\\n+exec\ wish\ \"\$0\"\ \"\$@\"\n+\n\ \ ##+##########################################################################\n\ \ #\n\ \ #\ dot2dot.tcl\ -\ a\ simple\ dot-to-dot\ game\n@@\ -21,8\ +25,12\ @@\n\ \ set\ xdots\ \{\}\n\ \n\ \ proc\ DoDisplay\ \{\}\ \{\n+\n+\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n+\n\ \ \ \ \ wm\ title\ .\ \"Dot\ 2\ Dot\"\n-\ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\ -padx\ 5\ -pady\ 5\]\ \\\n+\ #\ \ -padx\ 5\ -pady\ 5\]\n+\ \ \ \ \ pack\ \[frame\ .ctrl\ -relief\ ridge\ -bd\ 2\]\ \\\n\ \ \ \ \ \ \ \ \ -side\ right\ -fill\ both\ -ipady\ 5\n\ \ \ \ \ pack\ \[frame\ .top\ -relief\ raised\ -bd\ 2\]\ -side\ top\ -fill\ x\n\ \ \ \ \ pack\ \[frame\ .screen\ -bd\ 2\ -relief\ raised\]\ -side\ top\ -fill\ both\ -expand\ 1\n@@\ -32,7\ +40,6\ @@\n\ \ \ \ \ .c\ xview\ moveto\ 0\ \;\ .c\ yview\ moveto\ 0\n\ \ \ \ \ pack\ .c\ -in\ .screen\ -side\ top\ -fill\ both\ -expand\ 1\n\ \n-\ \ \ \ set\ colors\ \{red\ orange\ yellow\ green\ blue\ cyan\ purple\ violet\ white\}\n\ \ \ \ \ lappend\ colors\ \[lindex\ \[.c\ config\ -bg\]\ 3\]\ black\n\ \ \ \ \ foreach\ color\ \$colors\ \{\n\ \ \ \ \ \ \ \ \ radiobutton\ .top.b\$color\ -width\ 1\ -padx\ 0\ -pady\ 0\ -bg\ \$color\ \\\n@@\ -61,12\ +68,14\ @@\n\ \ \ \ \ button\ .restart\ -text\ Restart\ -command\ \{DoDots\ -2\}\n\ \ \ \ \ button\ .next\ -text\ \"Next\ Puzzle\"\ -command\ \{DoDots\ -1\}\n\ \ \ \ \ button\ .random\ -text\ \"Random\ Puzzle\"\ -command\ \{DoDots\ -3\}\n+\ \ \ \ button\ .exit\ -text\ \"Exit\"\ -command\ \{exit\}\n\ \ \ \ \ frame\ .pf\ -bd\ \[.next\ cget\ -bd\]\ -relief\ raised\n\ \ \ \ \ label\ .pl\ -text\ \"\ Pick\ Puzzle\"\n\ \ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n\ \ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n\ \n-\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\ -padx\ 5\n+\ \ \ \ frame\ .bframe\ -bd\ 2\ -relief\ ridge\n+#\ -padx\ 5\n\ \ \ \ \ checkbutton\ .build\ -text\ \"Build\ Mode\"\ -variable\ S(build)\ -anchor\ w\ \\\n\ \ \ \ \ \ \ \ \ -command\ ToggleBuildMode\n\ \ \ \ \ button\ .done\ -text\ Done\ -command\ Done\n@@\ -84,6\ +93,7\ @@\n\ \ \ \ \ grid\ .next\ \ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .random\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .restart\ -in\ .ctrl\ -sticky\ ew\n+\ \ \ \ grid\ .exit\ -in\ .ctrl\ -sticky\ ew\n\ \ \ \ \ grid\ .bframe\ -in\ .ctrl\ -sticky\ ew\ -row\ 11\n\ \ \ \ \ grid\ .sound\ -in\ .ctrl\ -sticky\ ew\ -row\ 51\n\ \ \ \ \ grid\ .about\ -in\ .ctrl\ -sticky\ ew\n@@\ -106,11\ +116,22\ @@\ \ \}\n\ \ proc\ ReColor\ \{\}\ \{\n\ \ \ \ \ global\ S\n-\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n-\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n+\n+\ \ \ \ .c\ itemconfig\ done\ -fill\ \$S(color)\n+\n+#\ \ \ \ .c\ itemconfig\ xline\ -fill\ \$S(color)\n+#\ \ \ \ .c\ itemconfig\ line\ -fill\ \$S(color)\n+\ \ \ \ .c\ itemconfig\ xline\ -fill\ black\n+\ \ \ \ .c\ itemconfig\ line\ -fill\ black\n+\n\ \ \ \ \ .c\ itemconfig\ dot\ -fill\ \$S(color)\ -outline\ \$S(color)\n-\ \ \ \ .c\ itemconfig\ extra\ -fill\ \$S(color)\n-\ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ \$S(color)\}\n+\ \ \ \ .c\ itemconfig\ extra\ -fill\ black\n+\n+\ \ \ \ \ catch\ \{.c\ itemconfig\ extra\ -outline\ black\}\n+\n+\ \ \ \ .c\ lower\ done\n+\n+\ \ \ \ \ update\n\ \ \}\n\ \ proc\ TraceBuild\ \{var1\ var2\ op\}\ \{\n\ \ \ \ \ if\ \{\$::S(build)\}\ \{set\ s\ normal\}\ \{set\ s\ disabled\}\n@@\ -303,14\ +324,16\ @@\n\ \ \ \ \ .c\ create\ oval\ \$xy\ -tag\ target\ -fill\ green\ -outline\ green\n\ \ \}\n\ \ proc\ DonePuzzle\ \{\}\ \{\n-\ \ \ \ global\ ddata\ dots\n+\ \ \ \ global\ ddata\ dots\ S\n\ \n\ \ \ \ \ set\ ddata(done)\ 1\n\ \ \ \ \ if\ \{\$ddata(close)\}\ \{\n\ \ \ \ \ \ \ \ \ eval\ .c\ create\ line\ \$ddata(\$ddata(last))\ \$ddata(1)\ -fill\ black\ -width\ 3\n\ \ \ \ \ \}\n\ \ \ \ \ .c\ delete\ target\n-\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ yellow\n+\n+#\ \ \ \ \ set\ color\ yellow\n+\ \ \ \ .c\ create\ poly\ \$ddata(xy)\ -tag\ done\ -fill\ \$S(color)\n\ \ \ \ \ .c\ lower\ done\n\ \n\ \ \ \ \ #\ Add\ to\ our\ pick\ puzzle\ widget\n@@\ -377,6\ +400,9\ @@\n\ \ \ \ \ set\ extra(\$name)\ \{\}\n\ \ \ \ \ Copy\n\ \ \ \ \ DoDots\ \$name\n+\n+\ \ \ \ SaveShape\ \$name\n+\n\ \ \ \ \ return\ 1\n\ \ \}\n\ \ proc\ ScaleIt\ \{n\ s\}\ \{\n@@\ -405,7\ +431,68\ @@\n\ \ \ \ \ clipboard\ append\ \"set\ extra(\$n)\ \{\$e2\}\\n\"\n\ \ \}\n\ \n-\ proc\ Shapes\ \{\}\ \{\n+proc\ SaveShape\ \{name\}\ \{\n+\ \ \ \ global\ env\ totalcount\ dots\n+\ \ \ \ set\ h\ \$env(HOME)\n+\ \ \ \ set\ fout\ \[file\ join\ \$h\ \".dots\"\ \"dot.\$totalcount\"\]\n+#\ \ \ \ puts\ \"debug:\ saving\ to\ \$fout\"\n+\n+\ \ \ \ set\ str1a\ \"set\ dots(\$totalcount)\ \{\"\n+\ \ \ \ set\ str1b\ \"\}\"\n+\ \ \ \ set\ str2\ \"set\ extra(\$totalcount)\ \{\}\"\n+\n+\ \ \ \ set\ chan\ \[open\ \$fout\ \"w\"\]\n+\ \ \ \ puts\ \$chan\ \$str1a\n+\ \ \ \ puts\ \$chan\ \$dots(\$name)\n+\ \ \ \ puts\ \$chan\ \$str1b\n+\ \ \ \ puts\ \$chan\ \$str2\n+\ \ \ \ close\ \$chan\n+\n+\ \ \ \ incr\ totalcount\n+\ \ \ \ set\ fname\ \[file\ join\ \$h\ \".dots\"\ \"count\"\]\n+\ \ \ \ set\ chan\ \[open\ \$fname\ \"w\"\]\n+\ \ \ \ puts\ \$chan\ \$totalcount\n+\ \ \ \ close\ \$chan\n+\n+#\ now\ update\ the\ menu\ gadget\n+\ \ \ \ destroy\ .p\n+\ \ \ \ eval\ tk_optionMenu\ .p\ S(new)\ \[lsort\ -dictionary\ \[array\ names\ ::dots\]\]\n+\ \ \ \ .p\ config\ -highlightthickness\ 0\ -bd\ 0\ -width\ 2\n+\ \ \ \ pack\ .p\ -in\ .pf\ -side\ right\n+\n+\}\n+\n+proc\ Shapes\ \{\}\ \{\n+\ \ global\ dots\ extra\ totalcount\ env\n+\n+\ \ \ \ set\ h\ \$env(HOME)\n+\n+\ \ \ \ set\ home\ \[file\ join\ \$h\ \".dots\"\]\n+\ \ \ \ set\ fname\ \[file\ join\ \$home\ \"count\"\]\n+#\ \ \ \ puts\ \"debug:\ checking\ for\ \$fname\"\n+\ \ \ \ if\ \[file\ exists\ \$fname\]\ \{\n+#\ \ \ \ \ \ puts\ \"debug:\ loading\ from\ file\ \$fname\"\n+\ \ \ \ \ \ \ set\ chan\ \[open\ \$fname\ \"r\"\]\n+\ \ \ \ \ \ \ set\ tcount\ \[read\ \$chan\]\n+\ \ \ \ \ \ \ regsub\ -all\ \{\\n\}\ \$tcount\ \"\"\ totalcount\n+#\ \ \ \ \ \ puts\ \"debug:\ totalcount\ is\ \$totalcount.\"\n+\ \ \ \ \ \ \ close\ \$chan\n+\n+\ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ \$totalcount\}\ \{incr\ i\}\ \{\n+\ \ \ \ \ \ \ \ \ \ \ set\ fname\ \[file\ join\ \$home\ \"dot.\$i\"\]\n+#\ \ \ \ \ \ \ \ \ \ puts\ \"debug:\ sourcing\ \$fname\"\n+\ \ \ \ \ \ \ \ \ \ \ source\ \$fname\n+\ \ \ \ \ \ \ \}\n+\n+\ \ \ \ \}\ else\ \{\n+#\ \ \ \ \ \ puts\ \"debug:\ loading\ defaults\"\n+\ \ \ \ \ \ \ defShapes\n+\ \ \ \ \}\n+\n+\}\n+\n+\n+\ proc\ defShapes\ \{\}\ \{\n\ \ \ \ \ global\ dots\ extra\n\ \n\ \ \ \ \ set\ dots(0)\ \{-286\ -8\ -242\ -18\ -217\ -37\ -191\ -66\ -176\ -89\ -173\ -133\ -146\n@@\ -649,8\ +736,8\ @@\n\ \ \}\n\ \n\ \ ################################################################\n+set\ totalcount\ 0\;\ #\ initialize\ global\ to\ no\ images\ loaded\ yet\n\ \ Shapes\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Load\ all\ our\ dot2dot\ shapes\n\ \ DoDisplay\n\ \ DoSounds\n\ \ DoDots\ -3\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Pick\ and\ show\ a\ puzzle\n-\n\n#\ end\ of\ comment\ loop\ around\ patch\n\}\n\n----\n\[\[\n\[Category\ Application\]\n|\n\[Category\ Games\]\n|\n\[Tcl/Tk\ games\]\n\]\]} CALL {my revision {Dot to Dots}} CALL {::oo::Obj3946853 process revision/Dot+to+Dots} CALL {::oo::Obj3946851 process}

-errorcode

NONE

-errorinfo

Unknow state transition: TR -> PRE
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4