Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/elements.py
diff options
context:
space:
mode:
Diffstat (limited to 'elements.py')
-rwxr-xr-xelements.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/elements.py b/elements.py
index 0ea1013..2e57470 100755
--- a/elements.py
+++ b/elements.py
@@ -21,7 +21,7 @@ class Letter:
@param character: the new letter string value
'''
- if(character == ""):
+ if(character == " "):
self.__is_blank = True
self.__character = character
@@ -174,7 +174,9 @@ class Board:
@param column: column on the board
@return: True or False
'''
- return (self.get_value_at(row, column) == "")
+ return (self.get_value_at(row, column) == "")
+
+
@@ -316,6 +318,21 @@ class Move:
'''
return self.length() == 0
+
+ def try_move(self, board, word, type, row, column):
+ ''' Try to insert the given word into the board.
+
+ @param board: the gameboard
+ @param word: the word to insert
+ @param type: the type of the letter, see the
+ utility.can_form_a_word function.
+ @param row: the row in the gameboard.
+ @param column: the column in the gameboard.
+ @return: True if it is possible and also valid to insert
+ the given word into the gameboard, otherwise False.
+ '''
+ # implementar....
+
class Bag:
''' Bag represents a "Bag" of Letters. It contains a dictionary
@@ -351,3 +368,4 @@ class Bag:
def get_bag_letters(self):
''' Get the bag of letters '''
return self.__bag_letters
+