Logo Search packages:      
Sourcecode: uligo version File versions  Download package

def uligo::App::convCoord (   self,
  x,
  orientation = 0 
)

This takes coordinates in SGF style (aa - qq), mirrors/rotates the
    board according to orientation, and returns the corresponding
    integer coordinates (between 1 and 19). 

Definition at line 406 of file uligo.py.

00406                                          :
        """ This takes coordinates in SGF style (aa - qq), mirrors/rotates the
            board according to orientation, and returns the corresponding
            integer coordinates (between 1 and 19). """
        
        m = map(None, 'abcdefghijklmnopqrs', range(1,20))
        pos0 = filter(lambda z, x=x: z[0]==x[0], m)[0][1]
        pos1 = filter(lambda z, x=x: z[0]==x[1], m)[0][1]

        if orientation == 0: return (pos0, pos1)
        elif orientation == 1: return (20 - pos0, pos1)
        elif orientation == 2: return (pos0, 20-pos1)
        elif orientation == 3: return (pos1, pos0)
        elif orientation == 4: return (20 - pos1, pos0)
        elif orientation == 5: return (pos1, 20 - pos0)
        elif orientation == 6:  return (20 - pos1, 20 - pos0)
        elif orientation == 7: return (20 - pos0, 20 - pos1)


    def setup(self, c, n = '', changeOri=1, co=None, ori=None):


Generated by  Doxygen 1.6.0   Back to index