-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functionality to launch and view a crossword
The `CrosswordBrowser` class in `main.py` now allows the user to select a crossword (read from `src/cwords/<name>`) and choose a word count preference (either the maximum amount of words for that crossword or a specified amount, starting from 3). The `load_selected_cword` method in `CrosswordBrowser` gathers the required instance attributes for the selected crossword (chosen word count and name), reads the selected crosswords definitions using `CrosswordHelper.load_definitions`, instantiates the crossword, then the best crossword is found using `CrosswordHelper.find_best_crossword`. `_configure_optionmenu_state` was implemented to appropriately disable and normalise the state of the custom word count optionmenu so the user cannot select both a maximum word count preference and a custom word count preference. `on_cword_selection` configures the radiobuttons to display accurate information pertaining to the selected crossword. Whenever a new crossword is selected, `self.selected_cword_name` and `self.selected_cword_word_count` are updated so the program is always ready to instantiate a crossword object when the user is ready. `CrosswordGame`, which inherits from `CrosswordBrowser`, is a ctk toplevel that fills the users screen and generates an empty version of the generated crossword. `_make_ref_grid` creates a grid without the word characters, which will be ideal for assigning user input to. `_make_cells` populates `self.cword_container` with either black or white squares (white being a cell where a character will be).
- Loading branch information
1 parent
2a27162
commit 53a2d67
Showing
10 changed files
with
272 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[m] | ||
scale = 1.0 | ||
appearance = light | ||
appearance = dark | ||
theme = dark-blue | ||
language = en | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"total_definitions": 69, | ||
"difficulty": 0, | ||
"symbol": "📌" | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.