Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ramírez <jorgeramirez1990@gmail.com>2010-05-20 01:10:48 (GMT)
committer Jorge Ramírez <jorgeramirez1990@gmail.com>2010-05-20 01:10:48 (GMT)
commit9baf722c05a4355e67c786e8437d946c7a84c932 (patch)
tree39233e02307ef4ddd4aa031b309bc3ecb8a993ea
parent8c0ea169c515736be21659baa9b0c1de15b0daa0 (diff)
Improved the create_board function
-rwxr-xr-xutility.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/utility.py b/utility.py
index baf42c5..b1d98a1 100755
--- a/utility.py
+++ b/utility.py
@@ -9,19 +9,18 @@ def get_unicode(data):
if not isinstance(data, unicode):
return unicode(data, "utf-8")
return data
+
def create_board(size):
board = []
- # To do hacer que sea dinamico
- if size == constants.DEFAULT_BOARD_SIZE:
- for i in range(0, size):
- board.append(['','','','','','','','','','','','','','',''])
-
- elif size == 9:
- for i in range(0, size):
- board.append(['','','','','','','','',''])
+ for i in range(0, size):
+ row = []
+ for j in range(0, size):
+ row.append(' ')
+ board.append(row)
return board
+
def get_letters_from_file(lenguage = constants.DEFAULT_LENGUAGE):
letters = {}