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

Source Code for Module cte

  1  #!/usr/bin/env python 
  2  # -*- coding: utf-8 -*- 
  3  # 
  4  #    cte.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  """Este módulo es para guardar las constantes que se usan en el programa.""" 
 22   
 23  import time 
 24   
 25   
 26  # variables 
 27   
 28  PLAYER_B = "player_b" 
 29  RANK_B = "20k" 
 30  PLAYER_W = "player_w" 
 31  RANK_W = "20k" 
 32  SIZE = 19 
 33   
 34   
 35  # Cte 
 36   
 37  WITH_WEBCAM = 1 
 38  WITH_VIDEO = 2 
 39  BLACK = 0 
 40  WHITE = 1 
 41  SPACE = -1 
 42  TEXT_INTERSECTION = "Intersecciones encontradas. ¿Estan bien?(Y/N)" 
 43  NAME_FILE = "Inserte el nombre del archivo y pulse Intro: " 
 44  EJE_X = 0 
 45  EJE_Y = 1 
 46  KEY_NOT_DOWN = -1L 
 47  THRESHOLD = 0.7 
 48   
 49   
 50  fecha_actual = time.strftime("%d %b %Y") 
 51  tiempo = 1800 
 52   
 53  INITSGF = ( "(;FF[4]GM[1]SZ[%d]" %(SIZE), 
 54              "\nAP[Tablerogo]",   
 55              "\nPB[%s]" %PLAYER_B, 
 56              "\nBR[%s]" %RANK_B,  
 57              "\nHA[0]",  
 58              "\nPW[%s]" %PLAYER_W, 
 59              "\nWR[%s]" %RANK_W, 
 60              "\nKM[6.5]DT[%s]" %fecha_actual, 
 61              "\nTM[%d]" %tiempo, 
 62              "\nRU[Japanese]", 
 63              "\n(" 
 64            ) 
 65   
 66  """ 
 67  CARACTERISTICAS DE LOS ARCHIVOS .SGF 
 68  ==================================== 
 69   
 70  * AB: Add Black: locations of Black stones to be placed on the board prior to the first move. 
 71  * AW: Add White: locations of White stones to be placed on the board prior to the first move. 
 72  * AN: Annotations: name of the person commenting the game. 
 73  * AP: Application: application that was used to create the SGF file (e.g. CGOban2,...). 
 74  * B: a move by Black at the location specified by the property value. 
 75  * BR: Black Rank: rank of the Black player. 
 76  * BT: Black Team: name of the Black team. 
 77  * C: Comment: a comment. 
 78  * CP: Copyright: copyright information. See Kifu Copyright Discussion. 
 79  * DT: Date: date of the game. 
 80  * EV: Event: name of the event (e.g. 58th Honinbo Title Match). 
 81  * FF: File format: version of SGF specification governing this SGF file. 
 82  * GM: Game: type of game represented by this SGF file. A property value of 1 refers to Go. 
 83  * GN: Game Name: name of the game record. 
 84  * HA: Handicap: the number of handicap stones given to Black. Placment of the handicap stones are set using the AB property. 
 85  * KM: Komi: komi. 
 86  * ON: Opening: information about the opening (fuseki), rarely used in any file. 
 87  * OT: Overtime: overtime system. 
 88  * PB: Black Name: name of the black player. 
 89  * PC: Place: place where the game was played (e.g.: Tokyo). 
 90  * PL: Player: color of player to start. 
 91  * PW: White Name: name of the white player. 
 92  * RE: Result: result, usually in the format "B+R" (Black wins by resign) or "B+3.5" (black wins by 3.5 moku). 
 93  * RO: Round: round (e.g.: 5th game). 
 94  * RU: Rules: ruleset (e.g.: Japanese). 
 95  * SO: Source: source of the SGF file. 
 96  * SZ: Size: size of the board, non square boards are supported. 
 97  * TM: Time limit: time limit in seconds. 
 98  * US: User: name of the person who created the SGF file. 
 99  * W: a move by White at the location specified by the property value. 
100  * WR: White Rank: rank of the White player. 
101  * WT: White Team: name of the White team.  
102   
103  """ 
104