Module notation
[hide private]
[frames] | no frames]

Source Code for Module notation

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  # 
 4  #    notation.py 
 5  #        
 6  #    Copyright 2010 Victor Ramirez <virako.9@gmail.com> 
 7  #        
 8  #    This program is free software: you can redistribute it and/or modify 
 9  #    it under the terms of the GNU General Public License as published by 
10  #    the Free Software Foundation, either version 3 of the License, or 
11  #    (at your option) any later version. 
12  # 
13  #    This program is distributed in the hope that it will be useful, 
14  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  #    GNU General Public License for more details. 
17  # 
18  #    You should have received a copy of the GNU General Public License 
19  #    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
20   
21  from cte import SIZE 
22   
23 -def notation(point):
24 """Función que tiene como parámetro de entrada un punto, y devuelve el 25 punto en la notación del tablero de go""" 26 27 if point[0] == 0: x = "a" 28 elif point[0] == 1: x = "b" 29 elif point[0] == 2: x = "c" 30 elif point[0] == 3: x = "d" 31 elif point[0] == 4: x = "e" 32 elif point[0] == 5: x = "f" 33 elif point[0] == 6: x = "g" 34 elif point[0] == 7: x = "h" 35 elif point[0] == 8: x = "j" 36 elif point[0] == 9: x = "k" 37 elif point[0] == 10: x = "l" 38 elif point[0] == 11: x = "m" 39 elif point[0] == 12: x = "n" 40 elif point[0] == 13: x = "o" 41 elif point[0] == 14: x = "p" 42 elif point[0] == 15: x = "q" 43 elif point[0] == 16: x = "r" 44 elif point[0] == 17: x = "s" 45 elif point[0] == 18: x = "t" 46 47 return x + str(SIZE - (point[1])) 48