diff options
author | Jorge 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) |
commit | 9baf722c05a4355e67c786e8437d946c7a84c932 (patch) | |
tree | 39233e02307ef4ddd4aa031b309bc3ecb8a993ea | |
parent | 8c0ea169c515736be21659baa9b0c1de15b0daa0 (diff) |
Improved the create_board function
-rwxr-xr-x | utility.py | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -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 = {} |