Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utility.py
diff options
context:
space:
mode:
Diffstat (limited to 'utility.py')
-rwxr-xr-xutility.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/utility.py b/utility.py
index 03731ab..338d2b4 100755
--- a/utility.py
+++ b/utility.py
@@ -17,7 +17,7 @@ def create_board(size):
for i in range(0, size):
row = []
for j in range(0, size):
- row.append(' ')
+ row.append("")
board.append(row)
return board
@@ -67,3 +67,36 @@ def search_word(lenguage = constants.DEFAULT_LENGUAGE, word, dict):
if not l2:
return False
return True
+
+def can_form_a_word(board, letters,letter, posx, posy):
+ ''' Check if the given letter can be used to form a new word
+ on the board.
+
+ @param board: the gameboard
+ @param letters: the list of letters to use.
+ @param letter: the letter at [row][column] on the board
+ @param posx: x-possition [row]
+ @param posy: y-possition [column]
+ @return: A tuple containing a regular expresion to use as a
+ pattern to search in the dictionary and the type of
+ the given letter. The possible types are:
+ - First letter of the word
+ - Middle letter.
+ - Last letter.
+ '''
+ # implementar...
+
+def search_words_that_match(criterion):
+ ''' Look for words in the dictionary that match with the given
+ pattern
+
+ @param criterion: the pattern
+ @param dict: the dictionary
+ @return: the list of words that matched
+ '''
+ #implementar...
+
+
+
+
+