/checkloc { % float => int (convert location to legal board location) 0 max BOARD_MAX min round } def /placestone { % event tag => - (place stone at event's x,y) ClientCanvas setcanvas % set current canvas tagprint uniquecid dup typedprint % send tag & id to client exch % uniquecid event begin % begin local dictionary XLocation checkloc YLocation checkloc % round location end % end local dictionary typedprint typedprint % send x,y to client [exch cidinterest1only] forkeventmgr % create eventmgr waitprocess pop % wait for events } def