Git Product home page Git Product logo

Comments (7)

joshbduncan avatar joshbduncan commented on September 16, 2024 1

@nicolesimon13, no, there is no level that allows for creating crossword puzzles. Crossword puzzles have different properties than a word search puzzle that inky adjusting the level would satisfy. This is the exact reason I rewrote the package, allowing for anyone to write their own generator. A crossword generator "could" force a certain amount of overlapping words, leave out the filler characters, and would need to track the clues, along with some other stuff I'm sure I am not thinking out. You would also need to write a formatter for properly displaying with crossword with the numbering for clues.

from word-search-generator.

joshbduncan avatar joshbduncan commented on September 16, 2024 1

@neocogent, yes you have it correct. It's simply a density problem. Then placing a word, the base generator picks random spots in the puzzle grid and checks if they are either empty or match the starting character of the word to place. If both of the checks pass, the generator then checks to ensure each letter of the word can be placed (using the same checks just mentioned) going in all possible directions. Then a random direction (from the directions that passed all checks) is picked and the word is placed.

So in a 21x21 puzzle, there are 441 available spots, and with 25 words (averaging a length of 7) there are a lot of potential random spots for the words to be placed. In this case, overlapping words are purely random.

Just so you can see it in action...

$ word-search cat bat -c -l 7 -s 5
WORD SEARCH
 ─────────
 T A S O Y
 C V T C H
 T A L B D
 B P T X U
 M M Q M O
 ─────────
Find words going SW, SE, NE, and, NW:
BAT, CAT

Answer Key: BAT NE @ (1, 4), CAT SE @ (1, 2)

$ word-search cat bat -c -l 7 -s 5
WORD SEARCH
 ─────────
 Y J D N Y
 S E T L S
 S A Q A Q
 C E K J B
 X G C E L
 ─────────
Find words going SW, SE, NW, and, NE:
BAT, CAT

Answer Key: BAT NW @ (5, 4), CAT NE @ (1, 4)

In the first run, the words share the letter "A", and in the second run, the words share the letter "T".

Even at 50 words in a 21x21 grid, I would say 50+ words would force some good overlap...

The latest version (still unreleased on PyPi) of the package that is available here on GitHub has abstracted the 'generator' away from the actual puzzle so you could write your own. When released, I plan to offer a few other generators along with the one currently implemented. One, I plan to work on will "force interactions/overlaps".

from word-search-generator.

joshbduncan avatar joshbduncan commented on September 16, 2024

Initially,only level 1, 2, and 3 existed. The other levels were added by a contributor was using the package for generating crossword puzzles. They should probably be changed and order in some way that makes sense.

When you say "sharing letters", do you mean overlapping letters? Like "cat" and "bat" overlapping diagonally so they "share" the "a". If so, the generator definitely allows for that already (in all directions). If you aren't seeing that, please let me know.

Thanks for checking out the project!

from word-search-generator.

nicolesimon13 avatar nicolesimon13 commented on September 16, 2024

"The other levels were added by a contributor was using the package for generating crossword puzzles. " - is there a level that allows for creating crossword puzzles? Because I can only see level one which still makes words touching or overlapping, not like a true criss cross puzzle with 'spaces' in between them.
https://www.pinterest.de/pin/859976491357596960/ shows an example

As for sharing letters - this goes into a similar thing like it did with my diagonal thing.
@neocogent: you can write your own test of the grid if there is overlap of the words and otherwise do another puzzle. that way you can also control how many of them are there. like "write grid with answers and check how often a cell is written into, if so +1, make sure whole puzzle is at least ...".

from word-search-generator.

neocogent avatar neocogent commented on September 16, 2024

I haven't properly checked puzzles for shared letters but I may do some analysis soon. I have only output a relatively few number and it seemed like I could find no instance where they shared.

Perhaps I am not adding enough words for a given size puzzle. For example, I've been mostly trying 21 row/col puzzles with 25 words. That doesn't seem very dense but what is typical for word searches you would find in newspapers?

from word-search-generator.

neocogent avatar neocogent commented on September 16, 2024

Thanks. Makes sense.

from word-search-generator.

duck57 avatar duck57 commented on September 16, 2024

I believe I picked the numbers 4,5, 7, and 8 so that the keys for the difficulty dict would all be ints. I can't remember why I chose those specific numbers. In retrospect, some of them should have been assigned negative numbers to signal that they're probably not the ones you want for most puzzles.

from word-search-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.