Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Crossword Generation Capability #2

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

CasimirCam
Copy link
Collaborator

closes #1

No clean handover either in- or out-of main() function.
@vercel
Copy link

vercel bot commented Mar 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
ai-crossword ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 23, 2023 at 1:34AM (UTC)

@CasimirCam
Copy link
Collaborator Author

General description of things to do (later, hehe):

  1. Add a smoother (less-dramatic) process to 'pass-over' words that don't fit in the puzzle & revisit them later (currently if this occurs, a break statement is encountered and generate_crossword() is called again.

  2. Build write-out method to place file in a deliberate, conspicuous location in the correct format, etc.

  3. Handle ingestion of answerBank and size - I'm not sure what the best way s, but a simple .ini file can be used with Python's configparser library.

@Seth-McKilla
Copy link
Owner

@CasimirCam
Copy link
Collaborator Author

Changed the input arguments to the main() script for clarity: gridLength and answerList with defaults for testing ability.

Added some basic input validation (acknowledging that some may be performed 'up top').

I'm not exactly sure how the addition of input arguments to main() is affected by the entry-point handling at the end of the main.py script (a common convention I've always used, but not entirely sure how it works):

if __name__ == '__main__':
    main()                    # <--- Does this line need the input arguments? Not sure.

A potentially useful excerpt regarding its usage:

"When a Python file is executed, the interpreter sets a special variable called name to "main" if the file is being run as the main program. If the file is being imported as a module into another program, the name variable will be set to the name of the module.

The if name == 'main': statement checks if the current file is being run as the main program by comparing the value of name to the string "main". If the comparison is true, the main() function is called.

This approach is commonly used to provide a module with both a library interface (when it is imported as a module) and a command-line interface (when it is executed directly). By separating these two interfaces, the module can be used in different ways, making it more flexible and reusable."

The output file is written to ./python/output/crossword_glossary.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Crossword Generation Tools
2 participants