max v2; #N vpatcher 1 45 919 705; #P origin 0 -69; #P window setfont Times 18.; #P window linecount 4; #P comment 719 327 112 1310738 make sure the mouse was released inside the window; #P window linecount 3; #P comment 641 247 237 1310738 translate window coordinates into matrix coordinates \, but let them through only on mouseup; #P window linecount 1; #P comment 281 108 237 1310738 initialize board to the color gray; #P window setfont "Fixedwidth Serif" 18.; #P newex 568 451 65 1441810 * 255; #P message 458 505 296 1441810 setcell \$1 \$2 val \$3 \, bang; #P newex 458 478 120 1441810 pack 0 0 0; #P toggle 568 431 15 0; #P newex 458 397 65 1441810 t l b; #P window linecount 3; #P newex 458 333 261 1441810 if $i1 >= 0 && $i1 < 20 && $i2 >= 0 && $i2 < 20 then $i1 $i2; #P window linecount 1; #P newex 634 221 54 1441810 == 0; #P newex 502 274 76 1441810 pack; #P newex 458 306 54 1441810 gate; #P number 568 249 54 18 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P number 502 249 54 18 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 95 79 98 1441810 loadbang; #P newex 568 221 54 1441810 / 20; #P newex 502 221 54 1441810 / 20; #P newex 502 194 142 1441810 unpack 0 0 0; #P newex 502 166 131 1441810 route mouse; #P message 95 107 186 1441810 setall 128 \, bang; #P newex 71 137 263 1441810 jit.matrix 1 char 19 19; #P user jit.pwindow 70 165 382 382 0 1 0 0 1 0; #P window setfont Times 18.; #P comment 58 546 409 1310738 380x380 window \, corresponding to a 19x19 'go' board; #P fasten 18 0 2 0 463 531 758 531 758 133 76 133; #P fasten 3 0 2 0 100 133 76 133; #P connect 2 0 1 0; #P connect 8 0 3 0; #P fasten 13 0 11 0 639 302 463 302; #P connect 11 0 14 0; #P connect 14 0 15 0; #P connect 15 0 17 0; #P connect 17 0 18 0; #P fasten 1 1 4 0 446 550 454 550 454 162 507 162; #P connect 4 0 5 0; #P connect 5 0 6 0; #P connect 6 0 9 0; #P connect 9 0 12 0; #P connect 12 0 11 1; #P connect 5 1 7 0; #P connect 7 0 10 0; #P connect 10 0 12 1; #P fasten 15 1 16 0 518 425 573 425; #P connect 16 0 19 0; #P connect 19 0 17 2; #P connect 5 2 13 0; #P pop;