| |
- __builtin__.object
-
- Grid
- Puzzle
- Word
class Grid(__builtin__.object) |
|
letter grid in worsdearch puzzle |
|
Methods defined here:
- __init__(self, puzzle)
- x, y are the dimensions of the grid. If y isn't supplied, a square grid is assumed
- add_padding(self)
- populate the empty cells in the grid with a hidden message
- clear(self)
- Clear the grid
- draw_as_cairo(self, surface, start_x, start_y, size_x, size_y, show_solution, selected_word, max_cell_size)
- Renders the grid onto a cairo surface.
Returns the font size used and the actual grid height
- get_cell(self, x, y, result_type='words')
- Return the content of reference (x,y).
result_type indicates the type of content to return:
words = words placed in the grid
padding = padding letters
both = both types of content
- get_grid_size(self)
- get_padding_text(self)
- Return the hidden message to be used for blank cells
- set_cell(self, x, y, letter)
- set_grid_size(self, x, y)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Puzzle(__builtin__.object) |
|
wordsearch puzzle |
|
Methods defined here:
- __init__(self)
- add_word(self, name, description=None)
- add an individual word to the puzzle
- clear_wordlist(self)
- Clear the location of all words from the puzzle
- delete_word(self, word_id)
- Removes the word with an index of word_id
- draw_as_cairo(self, surface, start_x, start_y, size_x, size_y, dpi, show_solution=True, selected_word=None, show_title=True, show_grid=True, show_words=True)
- Draws the entire puzzle onto the Cairo surface. dpi specifies the number of pixels per inch
- draw_as_text(self, show_solution, show_title, show_grid, show_words)
- Returns puzzle as a string for subsequent export
- get_is_forced_size(self)
- get_narrative(self)
- get_optimum_size(self)
- Returns the ideal grid size for the words in the puzzle
- get_title(self)
- get_word(self, word_id)
- Returns the word object with position in list given by word_id
- get_word_count(self)
- get_wordlist(self)
- Returns the puzzle's wordlist
- move_word_up(self, word_id)
- Moves the word with an index of word_id up one place
- populate_grid(self)
- Place all words on the puzzle grid. Returns True if ssuccessful
- resize_and_rebuild(self)
- A word has changed. Recalculate everything. Returns false if all words not placed
- resize_grid(self)
- Resize the grid and place all the words in it
- set_is_forced_size(self, is_forced_size)
- set_narrative(self, narrative)
- set_title(self, title)
- sort_wordlist(self)
- Sorts the word list alphabetically
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Word(__builtin__.object) |
|
word in puzzle |
|
Methods defined here:
- __init__(self, puzzle, word, clue=None)
- puzzle is the puzzle to which the word is belongs
word is the word text displayed to the user
clue is optionally the word as it appears in the word list
- clear(self)
- clear the word's location
- draw(self)
- draws the word in the puzzle's grid. This method does not update
the puzzle's hidden message
- get_clue(self)
- get_coordinates(self)
- get_direction(self)
- get_length(self)
- get_possible_locations(self)
- return a list of possible locations and directions where the word would
fit if the grid were empty
- get_word(self)
- get_word_alpha(self)
- place(self)
- find a free location in the grid and draw the word
Returns True if successful
- set_coordinates(self, x=None, y=None)
- set_direction(self, x=None, y=None)
- test_draw(self)
- checks whether the word will fit in the puzzle's grid
- update(self, new_word, new_clue)
- Change the word and / or description
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |