% constant definitions /BOARD_SIZE 19 def /BOARD_MAX 18 def /board_color .9 .69 .28 rgbcolor def % wood /line_color 0 0 0 rgbcolor def % black /draw_board { % - => - (draw the playing surface) board_color setcolor % playing surface color clippath fill % fill the client canvas line_color setcolor % set line color 0 1 BOARD_MAX { % draw board (0,0->0,18) dup 0 moveto 0 BOARD_MAX rlineto 0 exch moveto BOARD_MAX 0 rlineto } for stroke % stroke the path } def /makewin { % - => - (builds a test window) /GoWindow DefaultWindow % create a subclass dictbegin % begin instance defs /FrameLabel ( 1st Go board ) def % label the window dictend classbegin % begin method defs /PaintClient { draw_board } def /PaintIcon { draw_board } def /ClientPath { % x y w h => - 4 2 roll translate BOARD_SIZE div exch BOARD_SIZE div exch scale .5 .5 translate % move origin -.5 -.5 BOARD_SIZE BOARD_SIZE rectpath } def /IconPath {ClientPath} def % define icon image classend def /win framebuffer /new GoWindow send def % cliche /reshapefromuser win send % resize window /map win send % draw it } def makewin % run the program