Hee Hee....yeah, but that's MY part. No, the HARD part is to write the algorithms to decide where to put words into the crossword type configuration/display. IOW, if I were to 'steal/borrow' someone else's code for generating the puzzle (plenty of on-line sites do this (as I am sure you know)), then I can write the 'rest' of the program including a database of words and 'clues'.
I guess there used to be one at PSC, but as that site is down, not sure who might have captured that program in years past.
I guess also that if I were to THINK long enough (already in twilight years, so don't know if I have enough time!!!!), I could probably design my own.
Thx Pete....that submission is fine, but it is still 'manual' (I can easily do something similar), but what I am looking for is an 'automatic', per se, routine which will take a list of words and generate the puzzle.
Probably doesn't exist, so will probably continue as I am doing, making my own 'manually edited' puzzles.
I only did a search on the PSC repos on GitHub and haven't checked what it does.
Long time ago some friends were trying to create automatic generator where few words are set on specific positions (initial state) and the generator fills the rest, but don't have any memories if they finished or not.
Do you need a crossword puzzle generator for some quest? Once upon a time, I was one of the organizers of holiday quests, and I often had to come up with crossword puzzles with complex questions and draw them on giant posters. People were often surprised by my questions. Now I don't work there, but I continue to do crossword puzzles. It relaxes me, but it also keeps me from getting dumbed down.
Last edited by Shaggy Hiker; Jan 10th, 2022 at 01:43 PM.
Reason: Removed broken link.
Here is a little something I threw together for fun. It generates puzzles, crappy puzzles, but useable. Maybe you can fiddle with it and make it better.
some notes:
1) results are skewed towards Down, havent figured out yet why.
2) Interface is basic because I didnt want to add any dependencies
3) not all words are usually solved, could be improved
4) sometimes you get results like R|O|B|I|N|U|T|H|A|T|C|H which is probably not desirable
5) Interface doesnt spring to puzzle size if it expands past 15 rows, to lazy to add the code
6) the framework for harder puzzles is laid but only across and down are fully implemented
7) check and reveal arent done
any questions just ask
regards, Lewis
Last edited by vbLewis; Jan 30th, 2022 at 09:42 AM.
Reason: deleted old code see new update below
Ive done a lot more work on this Puzzle Generator and im fairly happy with the puzzles it now produces. Results are spread more evenly Across and Down.
1) added resizing code, form now springs/resizes to the puzzle size
2) you can now scroll manually though generated puzzles
3) added a print preview form to nicely print the puzzle to paper
4) generating engine is alot smarter and does a pretty good job
5) fixed several bugs
6) finished all the code needed to reveal and check letters, words, puzzle
7) you can now see what percent of the puzzle you have solved and it informs you when you have completed
8) added highlighting code for when you click on a clue or puzzle text box
9) the only thing left to do is finish code for harder difficulties (only across and down currently)
Im considering submitting this to the codebank and would love some feed back
Last edited by vbLewis; Jan 30th, 2022 at 09:41 AM.
Not bad work...(and it seems like quite a bit)...thanks for posting it.
BUT, it does lack 'true' crossword rules...like, in your example, after you put in 1 Down, and then 2 Across...you have on the top row, the first letter of 1 Down right next to the first letter of 2 Across. This is repeated several times in your puzzle. A true crossword puzzle would have an unused square to the right of square 1, and 2 Across would start on the third square....OR, there would be a 1 Across as well as a 1 Down.
Also, your two lists should be sorted numerically.
But, like a said...good job (so far). I'd wait a bit to put in codebank (as a finished product anyway), until it more resembles a true crossword puzzle.
If you cant tell, I am a total newb when it comes to crossword puzzles, so even though ive done a little research the exact rules on what makes a good crossword puzzle are unknown to me.
Do you have any more ideas or suggestions on what can make it better?
I have added complete word highlighting now when you select a starting point of a word, clue lists are sorted, and a few more puzzles.
I will have to do a little more work on the rule you mentioned.
Edit: Does this seem like the correct rule?
For a vertical word, a horizontal word cannot start anywhere above or to the right of its starting point,
a vertical word cannot start below it...
For a horizontal word a vertical word cannot start below or behind it, a horizontal word cannot start after it
Thanks
Lewis
Last edited by vbLewis; Jan 24th, 2022 at 05:18 AM.
First, here is an example of a puzzle I am used to...
At the end of every word, either across or down, an EMPTY (black) square must appear.
There can be no non-word created by adjacent (side-to-side nor up-and-down)...in other words, every set of letters (2 or more) MUST be a word itself.
I think that may be the 'rules' that make sense.
PS-when I did a new 'clu file (copied your Birds one and made up my own clues), several words did not fit, meaning that some words started in the middle of another word, and was not the correct letter, causing the first word to be incorrect.
If you can actually do a puzzle like the one attached, I think that WOULD be a GREAT Code-Bank entry!!!!!
Thank you for the time you are devoting to this challenge.
Okay....I just 'solved' that crossword puzzle above (all except one 13-letter word (14 Across)----maybe someone else can finish this (also check my other 'answers')).
12 Down: wth is "Racketing"?? (For "Translation, a performance") --> would have tried "Rendition"
Last edited by Zvoni; Jan 24th, 2022 at 08:11 AM.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
EIDT: Hmmm...then what are 18 and 24 across...will not fit with RENDITION for 12 Down?
Yeah, saw those, too, but .... "Racketing"? Seriously?? *lol*
EDIT: Ahhhh.... "Rendering"... at least i was close... *lol*
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
So, Z...can you help vbLewis with some 'rules' guidance...not sure if my explanation and the images say it all for a coder.
Sammi
Not really. Never was an avid "Crossworder", so i wouldn't even know the rules implied there.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
vbL....
1. Each NUMBER you see represents the start of a new word.
2. At the end of each word, a blank space (I'll refer to these blackened/darkened squares as 'blank spaces') is required
3. Blank spaces are required where there are no letters from any words
4. A number can be the start of an Across word as well as a Down word (see #5 in the puzzle)
5. Letters from Across words can be a part of Down words where they intersect (Hence the name of these types of games is 'Crosswords')
6. Include in the clue both the Number as well as the number of words in the clue--like: 8 Skin Mark (4)
Hi Sam,
This looks like a British style grid, as far as i know there are 2 main styles, American and British. I will try to work on being able to generate both kinds.
more info here: https://www.edinformatics.com/invent...ord_puzzle.htm
I have found personally playing with the number of rows allowed and generating larger amounts seems to get better results.
Also scrolling manually through the generated puzzles allows to pick a better choice than the generator picked.
Your feedback has been invaluable, and will help me alot. I have posted the latest source below with some new clue files if you wish to play around with it.
I have added the length of the word to the clues...
I will post again when i have made more progress.
Thanks for your feedback
Last edited by vbLewis; Jan 30th, 2022 at 09:41 AM.
didn't look at the code yet, but your image shows great progress...however, note the LARGE numbers...they should start at 1, and increment only by 1 for the next clue, i.e., 1, 2 3 ...etc...never should be large numbers like you have (170, 400, etc).
EDIT...you got code for last iteration?
Last edited by SamOscarBrown; Jan 25th, 2022 at 07:43 AM.
didn't look at the code yet, but your image shows great progress...however, note the LARGE numbers...they should start at 1, and increment only by 1 for the next clue, i.e., 1, 2 3 ...etc...never should be large numbers like you have (170, 400, etc).
EDIT...you got code for last iteration?
Im still not happy with the current puzzle generation, there are still occasionally some problem 2 character areas, and I feel the puzzle could be much denser.
As for the numbering of the clues, they are keyed to thier text box index which makes for easy look up, but the smaller numbering can be done it will just
take a little more code.
Im also adding a clue file editor and word/clue file generator using large databases i found online. But its just started.
So there is still much work to be done, unfortunately i probably wont be able to get back to it till the weekend.
Heres the latest code if you want to play around with it.
Regards,
Lewis
Last edited by vbLewis; Jan 30th, 2022 at 09:41 AM.
What looks obvious to me is that there are twice as many horizontal words as there are vertical. So perhaps put in some "balancing word direction placement logic" that when a horizontal word is placed then a vertical word needs to be placed next, followed by a horizontal word, etc, Also seems to be that more longer horizontal words are placed than vertical ones. Through playing with other puzzle programs I noticed that increasing the size of the puzzle tends to improve word placement. Almost seems like a Black and Red Balancing Tree is needed.
Also when printing puzzles, filled black squares tend to use up printer cartridges faster so I tend to change the print fill colour to a grey shade.
Just a few suggestions. Not meant to be critical but just stating some observations. I am really impressed with your program. Always wanted to see a Vb6 Crossword Puzzle Maker created. On the old PlanetVB board Mr Kenneth Foster made an upgrade to a Vb6 Wordsearch Program before the site got closed down, but I never did see much of a Crossword Puzzle program being created (just an older basic version made years ago). Take care and many thanks vbLewis for the updates.
Also forgot to mention that there is a nice C# Crossword program at Codeproject called Mr Crossword that seems to have some good logic to place the words in both directions evenly (At "https://www.codeproject.com/Articles/1271730/Mr-Crossworder-Create-Crosswords-in-Seconds"). It might be good to look at the logic that they used. This Crossword puzzle maker is also unicode. The same author made a Wordsearch program that uses a JSON representation of Webster's Unabridged Dictionary which is on GitHub ("https://github.com/adambom/dictionary").
Last edited by CreativeDreamer; Jan 25th, 2022 at 05:51 PM.
Reason: Added info.
Hi CreativeDreamer, Thankyou much for your input and observations, I've followed some of your links, info and suggestions. Much appreciated.
I am releasing an updated version with a much improved puzzle generating engine, It now actually follows rules. Other changes have been made and here are some worthy of note:
1) Added two huge word lists, to source random puzzle generation from. The New York Times historical puzzle database with 650k entries and a English word dictionary with 44k entries. See the readme file for more info.
2) Added the ability to have non-used puzzle squares be grey (as suggested by creativedreamer)
3) revamp the print preview to allow 2 pages if puzzle and clues dont fit on a single page.puzzle on page 1, clues on page 2. (needs testing i dont have a printer atm)
Also puzzles are now resized to fit entirely on the page regardless of grid size.
4) complete rewrite of the puzzle generating engine, it now follows strict rules when looking for word placement. (as suggested by Sam)
5) the ability to right-click on a word and remove it from the puzzle (such as a non-intersected word) allowing you to fine-tune a puzzle before printing.
6) A new option for puzzle generation 'Least Orphaned" meaning it will pick the puzzle with the least amount of non-intersected words as the winner.
7) Clues are now properly numbered like normal puzzles (also suggested by Sam), and highlighting now switches between across and down of the same number like the Washington Post online puzzle.
Unfortunately, the data files for the NY Times historical puzzles and the Dictionary are to large to include in the zip file, so I have added the links to download them in the readme and the source code. I also went ahead an made it possible for the program to automatically download the files if the user wishes.
Last edited by vbLewis; Feb 11th, 2022 at 08:55 AM.
Reason: scroll down for download
First of all....this looks (before I even download your project) fantastic! I'm wondering if it IS good enough to add to the CodeBank on this forum (maybe a moderator will download it and check it out for an assessment).
Secondly, THANK YOU for the hard work...I have been wanting such a puzzle generator for some time, but all MY (feeble) attempts at one have failed.
First of all....this looks (before I even download your project) fantastic! I'm wondering if it IS good enough to add to the CodeBank on this forum (maybe a moderator will download it and check it out for an assessment).
Secondly, THANK YOU for the hard work...I have been wanting such a puzzle generator for some time, but all MY (feeble) attempts at one have failed.
Sammi
Thanks Sammi, I hope you like it. Ive been enjoying the puzzles myself.
That being said there is a nasty bug that slipped by me in the RefreshPuzzlesMenu sub.
I have fixed it an reuploaded but you can easily fix it yourself if you wish
In the following code
Code:
'unload if needed
Do While MenuCount > 0
Unload mnuPuzzles(MenuCount)
MenuCount = MenuCount + 1
Loop
Very good job...
I did NOT download/use those two files mentioned in your Readme.txt file (yet). Maybe that is why my puzzle (I created one for a Bible New Testament) had several horizontal words NOT intersecting with any vertical ones...this SHOULD BE a requirement (rule) for a crossword puzzle (not necessarily a 'puzzle', but certainly a CrossWord Puzzle.
Here's what my complete puzzle (with clues) looks like. Oh, BTW, I know when I PRINT a puzzle, the clues will be readable in their entirety, but if I'm doing it on a computer screen, several longer clues get cut off...maybe those lists should have horizontal scrollbars???
So, I tried your Least Orphaned Words and the suggested puzzle had only 2 (where the one I showed above has 8 or so). Is there a way to have NO Orphaned Words, yet still use the majority of those provided in the clu file? (I've attached my (slightly modified since running the puzzle above) clu file.)
BTW...this is still a very good (although not perfect) program...
Thanks Sam for checking it out. been busy lately so progress has been a bit slower.
Im currently re-writing the whole word placement engine that i think will get better results and also making so no orphaned words will be left.
To address some of your suggestions.
1) horizontal clue list scrolling. This isnt possible with VB6's default list control which is a result of me choosing to stay with basic built in controls. If you click on a clue though in the list or a word in the puzzle, the blue label at the top should display the full clue.
2) Centered Letters. This can be done easily by changing the justification on the txtPuzzle textbox, however the reason I right-justified them is because the little index number isn't transparent and can cover the corner of some letters which looks weird. This again is a limitation in vb default controls where transparent labels wont Z-order over top of textbox controls and i had to use small textbox's (which are not transparent) to hold the number with the background color the same as the puzzle letter. Ive thought of maybe using a text drawing api to print the number into the corner of the puzzle letter but haven't got to that point yet and not sure if it will even work, but i plan on exploring options sometime in the future.
Yeah...no problem with the 'narrow' lists (I hadn't paid much attention to the clue being placed in a label---good choice). And as far as centering the letters, I understand...again, no problem (for me) leaving them right aligned.
Yes, looking forward to 'no orphaned words'!!!! You get THAT done, I'll recommend to the moderators let you post in the CodeBank.
When you guys are done, you need to turn it into a crossword-solver. Just specify the dimensions and where the black spaces are, and let it crunch. Just forget about the clues. When/If it's done, see if the solution makes sense with the clues.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
When you guys are done, you need to turn it into a crossword-solver. Just specify the dimensions and where the black spaces are, and let it crunch. Just forget about the clues. When/If it's done, see if the solution makes sense with the clues.
Thats a pretty cool idea, may have to try that. At the moment im kinda cross worded out tbh
I dont think I am able to get this puzzle generator much better than it currently is, so any new updates will just be finishing support code and adding features.