Git Product home page Git Product logo

crossword's Introduction

Puzzle generator

By AndrewRigg and Golpette.

   

It's puzzle game adventure fun time madness. No longer restricted to crosswords, this program also generates wordsearches and (soon) sudokus too.

     

Program written in Java. Using the program in its current form:

Choose your puzzle, size and difficulty from the initial screen. (Languages are currently obsolete, as is sudoku and the crossword difficulty).

Crosswords: generated randomly using an English word list of ~17,000 words with clues corresponding to dictionary definitions. Scroll through the puzzle with arrow keys or mouse and enter solution using keyboard. Check your solution with the "Show solution" button, or get hints by hovering over the space below the clues and clicking "Hint".

Wordsearch: to highlight word, click on the initial letter, followed by the final letter of the word. You can cheat using the "Show solution" button. Difficulty levels restrict word directionality (only vertical and horizontal for easy to the inclusion of "word snakes" for expert. Word snakes are not restricted to straight lines but can snake around in the up/down/left/right directions... though you can't actually highlight these yet). Hover over the word list to re-order them as you like.

Sudoku: to do.

crossword's People

Contributors

andrewrigg avatar golpette avatar

Watchers

James Cloos avatar  avatar Cameron Craig avatar  avatar

crossword's Issues

Sort spacing of crossword clues.

Make sure there isn't a big gap between the crossword grid and the clues. Also make sure that when resizing, the grid remains on the frame and the clues get squashed out but without moving away from the grid.

Wordsearch: Randomised letters won't change colour

There is seemingly a bug where the letters which are generated between the words will not change background colour when the mouse is clicked. I have no idea why. (Probably something obvious and stupid I've done)
This is in DrawWordSearch class.

Good luck!

Word Search: Word Snakes

Create an 'expert' option for the word search which allows words to snake around in any direction.
(Had this mostly implemented but it contained a few bugs.)

Add Hint option

Allow the user to press on a button to give a hint to each clue. This would be an anagram of the word itself.

Put wordsearch words in columns.

Allow the wordsearch words (clues) to be listed in more than one column (vertically to right of the grid) so that the overall height is the same as the grid.

Prettify crossword

Make the crossword GUI look modern, nice and usable. Think about the use and positioning of buttons, labels etc. Think about rounded edges, shadows, fonts, backgrounds etc.

Text Borders to show more clearly against images

Could try to implement method to add outlined border to font by using imported method.

Alternatively (easier and hackier) just use JLayeredPane to put two identical labels, with text in one emboldended and both transparent.

Closing solution does same action as hide solution.

Need to ensure that when the solutions for the various puzzles are shown, pressing the 'x' in the top right corner has the same effect as pressing the 'hide solution' button. In other words it makes the crossword text go back to normal.

Missing .txt files

I tried to get this thing going and encountered the following error:

java.io.FileNotFoundException: words_cambridge.txt (No such file or directory)

My guess is that you have this file, and the repository doesn't?

Document code properly

Some classes have zero comments. Write proper code documentation: comments, method explanations etc. Very important if we're collaborating and I want to edit/play with what you've done!

Wordseach: add highlighting method

Add method for users to highlighting the words (and also how to display the solutions).
Before implementing something, let's discuss here the best way we think we can do this, since there are a few different options.

Ambitious Future Plans

This issue is where we will put all our most ambitious, unrealistic or difficult plans.
1.
2. Allow user to swipe puzzle left, so that it rotates a cube to the adjacent face to show the previously saved puzzle.

  • Allow user to swipe down to rotate through the puzzle types, swiping down would always cycle through the most recently worked on puzzles in each category eg: crossword #2->sudoku #3 -> wordsearch #4 -> crossword #2 again etc...
  • Allow user to swipe up to remove (delete) current puzzle. It could bring a pop up notification to allow the user to confirm they want to get rid of the current puzzle. Once confirmed, the next most recent puzzle would rotate into place.
    (Design like certain android UI features like getting rid of home screen tab)
  • We could include text-to-speech functionalities e.g. a voice reads out correctly identified words. Or could read out questions and then the letters already identified. (This could allow people to do the crossword without having to read, say when driving [probably not the best example], or for people with eyesight problems.
  • Related to the last issue, we could voice-recognition functionalities e.g. so that you can say a word to insert into the crossword. This could work hand in hand with the text-to-speech, allowing a user to complete a crossword by listening and speaking into a device, so it could be running when the screen is off say.

Allow user to ctrl+scroll (pinch and zoom on mobiles) to resize the whole grid of the puzzle. This would allow users to see the entire grid or easily recentre on the part they want.

Clue & entry encoding issue

I noticed that one of the clues contained "£1.05" in it, but the £ symbol is not handled correctly.

Also need to test the encoding with Spanish wordlists: can we easily use é,á,í,ñ, etc... in both clues + crossword?

Organise project setup

Create proper folders and hierarchies of files in the project so that it is easier to use when more complex and expanded.

More precisely create sub packages in the source folder e.g.

  1. Crossword - All crossword related code
  2. Wordsearch - All wordsearch related code
  3. Sudoku - All sudoku related code
  4. GUIs - All GUI classes and related code
  5. Resources
  6. Algorithms

(Something like this - but think about the most logical and efficient structure)

Make all solutions scrollable

Allow scrolling in the solutions of crossword and wordsearch. When size is set to ~25+, the solution is bigger than the window and so scrolling would be useful.

Wordsearch: new fitting class

Separate classes for fitting procedures in wordsearches and crosswords.

The original crossword procedure is designed to avoid things like adjacent words (since then we'd have multiple adjacent white squares that did not form a word) and is thus overly restrictive: in a wordsearch we don't care if 2 words are side by side.

This will make it easier to specifically modify for diagonal/backwards words in wordsearches.

Implication: highlighting all words in same colour in the solution will make it tricky to distinguish words. Either need to choose different colours for different words or use something like loops / lines to highlight them.

We can set a number of words to fit depending on size of grid.

Implement the Sudoku Generator

Implement a method of removing numbers from the completed sudoku grid to generate the actual puzzle.
Research online to find different ways of doing this, try different methods for different difficulties.
May nee Heuristics and more complex algorithms.

Wordsearch: remove circles

I have never seen wordsearches with circles. I find it visually confusing and would prefer just a blank background with the letters as is normal. What do you think, Andy?

Improve usability of crossword textfields.

Allow the user to select other boxes easily by using the arrow keys, or when typing a letter the cursor should move to the next available box.
When deleting, the text should be removed from subsequent boxes. If there is no word across but a word down, the cursor should jump to the next textfield down.

Wordsearch: word length weighting

If we select totally random word lengths we end up getting too many 3 letter words. If we always fit the largest possible, the wordsearch looks a little odd.

Play with some weighting factor until they look good.

Fix error on sudoku solution generation

Once the completed sudoku is (successfully) generated, an error is thrown up due to imperfect calling of methods and looping.

Try just forcing the offending value to be outside the error once the check for a complete grid has been met.

Save user data to a database.

Save correctly inputted user data to a SQL database.
This will allow users to log back in and eventually load saved puzzles etc.

Crossword: Proper hints

Make the hints have a unique anagram which doesn't disappear on mouse exiting the label area.
The randomised anagram should be checked against the original word so that it does not just show the solution.

Add wordsearch

Add in basic functionality for a wordsearch using the same algorithms from the crossword.

  • Don't need to check if grid is connected
  • Can use random letters to fill spaces
  • Do we need to save random letters to show in solution

Wordsearch: number of words

Currently WordSearchGenerator.java has a "num_words_to_fit" variable.

Find a good way of choose the number of words depending on the size of the grid.

Alphabetise wordsearch clues

Alphabetise the words along the side of the grid so that it is more easy to read and find the word you are looking at. (Or order them in some other way.)

Save all user data

This would be a method to take all the meta data about the current puzzle, including the user's inputted letters/answers so far, and save them for later use.

  • This could have a maximum size, say 10 open puzzles for each type.
  • There could be a method to save any given data to a file under a folder named after the user. This would be created when the user successfully signs up.
  • There could be a similar method to run through the saved data to show the current puzzle.
  • Perhaps this should have a heap like structure, so that you know the most recent puzzles looked at - push/pop actions.
  • The data could sporadically be saved to a database so that it is able to be recalled at a later date, or if the user removes the data from their own device.

Crossword: Highlight textfield on entry

Add that a mouse click on first letter of a word highlights the corresponding spaces in light blue. Second click will highlight a "down" word if there is one beginning from this same square.

Count clicks and just use even/odd numbers to distinguish?

Also, when alternating like this between across/down, we can flip the prioritisation so that if a down word is highlighted the cursor now favours down rather than across.

Wordsearch: difficulty selection

Could add various difficulty options: "Easy" might only include down and across words, "medium" diagonal and back, "hard" backwards-diagonal too.

Maybe number of words too?

Ideas?

Wordlists and languages

Generate wordlists and vocab sets for various languages.

I have a script that will translate files from English to any language using Google translate. (Check terms of use: is this legal?)

Vocab set ideas: animals, food, places, household objects, body parts, nature, countries, verbs, sports, emotions and feelings, clothing

Possible issue: are non-standard characters á, é, í, ó, ü, ñ dealt with OK?

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.