Git Product home page Git Product logo

crossword-layout-generator's People

Contributors

michaelwehar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crossword-layout-generator's Issues

Words occasionally overlap

Occasionally two words in the same direction overlap. For example:

{
clue: 'just born',      
      answer: 'baby',
      orientation: 'down',    
      startx: 16,
      starty: 15
}

{
      clue: 'feline',
      answer: 'cat',
      orientation: 'down',
      startx: 16,
      starty: 14,
}

For some reason with these specific words it happens nearly all of the time:
baby, cat, nicotine, chocolate
Baby and cat consistently overlap as do nicotine and chocolate.
For now I am doing manual checks to ensure this doesn't happen, but I'm stumped as to what's going on here.

I am currently generating the crosswords by selecting 5 random words from the following:
baby, cat, university, nicotine, chocolate, cactus, aquarium. The two aforementioned pairs consistently overlap when they are selected regardless of the other words.

Convert to gdscript language

I have been trying my best to convert the code to gdscript (scripting language used in the Godot game engine), but the result are not exactly as the JavaScript's

Isolated Words and Small Word Islands

Currently, the layout generator will sometimes add isolated words and smaller isolated word islands to the layout. In some cases, we want to maximize the number of words that we fit in the grid. However, I think that in general we might want to remove isolated words and small word islands.

I suggest that there should be an option that (if set) will automatically remove isolated words. Also, there could be a parameter for removing small word islands that contain fewer than the parameter many words.

Adding more comments & explanation

Some of the code is a bit cryptic. Maybe we could restructure it and add more explanation so that it's easier to understand so that others can contribute more easily.

Crossword size

Is it possible to add a way to limit the generated crossword to specific bounds eg. a 15 by 15 crossword?

No package available

Hi

Thanks for your cool script. It's exactly what I need for my personal project. Do you have any plans about releasing the package on npmjs?

It would really simplify development and deployment.

Thanks in advance

Michael

Measuring the Generator's Performance

When building a crossword layout, the generator makes a sequence of decisions. Each decision is greedily made to maximize a hard coded function.

The hard coded function incentivizes number of connections between words, longer words first, equal number of vertical and horizontal words, and word placement near the center.

Let's call the hard coded function our fitness function (even though it might not be a conventional fitness function).

Goal: Evaluate the performance of our crossword layout generator's fitness function.

Here are some things that we can do to help us meet our goal.

  • We can create a data set of professionally made crossword puzzle layouts.
  • We can propose approaches for vectorizing crossword layouts.
  • We can run simulations to try to learn fitness function parameters that lead to better crossword layouts.

Can we fixed crossword layout size?

I am facing an issue with handling crossword layout size. because sometimes crossword sizes are larger to handle please suggest possible solution

order of the input impacts the generated layout - why ?

when I change the order of the objects {answer: 'xxx', clue: 'yyy} within the input array to the main generateLayout() function I get a different layout.

considering the fitness function - could be that a different order of the input will yield a better layout ?

Answers don't recreate crossword

I want to recreate a crossword grid using only the answers. As a test I am using answers from a known grid (15x15 blocked crossword).
I input the answers, but the created grid does not match the known grid and is too big.
I have set:
var rows = 15; and
var table = generateTable(blankTable, rows, cols, words, [0, 0, 0, 0]);
in
function generateSimpleTable(words)
which makes a better match, but not identical.

What else do I need to change to make this work?

Thank you.

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.