philhanna / crossword Goto Github PK
View Code? Open in Web Editor NEWCrossword puzzle editor
License: MIT License
Crossword puzzle editor
License: MIT License
The user should be able to start typing in the "Word" input box.
Clear all the letters that are not part of an already completed word
Once a puzzle is complete, need a way to export it to PDF in various formats. To begin with, I'm only using the NYTimes format. See Times submissions for details.
I have working code in nytimes_output.py
, but it requires a file name for the output and a puzzle object. The GUI needs to supply these two things.
Right now, I have it as a top-level menu option, but maybe it should be part of the puzzle menu?
The modal dialog edit-word
obscures the puzzle.
The new grid dialog prompts for an odd integer for the grid size. The input field is validated as being:
However, the program does not check whether it is positive.
Need to add this capability
Currently the system uses gridnxn or puzzlenxn as the initial name when a new grid or puzzle is created. Better to switch to (untitled)
. Then do not allow file to be saved when untitled, only "Saved As" a real name.
In publish -> New York Times format, the output is generated and downloaded, but the puzzle chooser dialog is still present. Need to redirect to main screen.
See closed issue #46
The size, errors, word count, and word length table are repeated, concatenated with the old.
At present, you have to be completely done with designing a grid (the black cells) before you can create a puzzle from it. This makes it inconvenient if you have been working on a puzzle for a while and then realize that you need to change the grid structure. You don't want to lose all the work you've done.
This consists of several tasks:
nytimes_output.py
to use DOM rather than generating HTML manuallywebapp.publish_nytimes_screen()
, create a .zip file with these two filesThe bottom border is too small. Same is true with puzzle chooser dialog.
This seems to be left over. I now put the word length in the header, but I still see the tool tip when I hover over the label.
Menu option to see:
Currently this information is only seen when the grid is saved.
Sometimes when editing a grid, the cells that should be numbered don't always get new numbers.
I have noticed this when I click a cell and then click it again to clear it.
I have also noticed that when I click outside the grid it seems to cause the renumbering.
Need to be able to export a puzzle to .csv
and import from .csv
. This will allow someone to work on the clues outside of the application. The system already has the capability to do this (see clue_export_visitor
), it just needs to be integrated with the menu.
The raw .csv
file can be edited directly with Microsoft Excel, or uploaded to Google Drive so that it can be shared with whoever needs to update it.
Currently, the user can click on any set of cells in the grid to make them black cells.
However, not all these configurations are valid. For example, the New York Times
requires that:
- Crosswords must have black square symmetry, which typically comes in the form of 180-degree rotational symmetry;
- Crosswords must have all-over interlock;
- Crosswords must not have unchecked squares (i.e., all letters must be found in both Across and Down answers);
- All answers must be at least 3 letters long;
- Black squares should be used in moderation.
(Source: NYTimes submissions guidelines)
When the user chooses "Save grid" or "Save grid as...", the system should ensure that these guidelines are met. If not, the save should be prevented and message should be flashed.
Unit tests run fine in PyCharm, but not from a command line. test_wordlist
fails because it can't find ../words
.
From the beginning of the editing session for a puzzle, keep track of each time the Edit Word OK button has been clicked, and implement undo/redo for the word value.
Currently, the validation messages are all run together, separated by titles that start and end with "***".
Need to return the three validation sets individually, so that they can be displayed better in the UI.
It's clumsy to have to dismiss a message dialog. Better to have a place in the main screen where messages can be displayed. There is frequently only one message; perhaps a w3-panel
at the bottom of the screen? Still with a close X.
grid-chooser-ajax.js
currently builds anchor tags within list items manually with
string concatenation. This is fragile and error-prone. Better to build DOM child elements
with the DOM API, as in do-suggest-word.js
.
links = "";
for (i = 0; i < grid_list.length; i++) {
filename = grid_list[i]
href = build_url(filename)
quoted_href = "'" + href + "'"
anchor = "<a href=" + quoted_href + ">" + filename + "</a>"
listitem = "<li>" + anchor + "</li>"
links += listitem + "\n"
}
document.getElementById("grid-list").innerHTML = links
Getting a key error in puzzle_screen() line 283:
puzzle = Puzzle.from_json(session['puzzle'])
In Firefox, if I click on a grid, the parent x and y coordinates of the containing element are different than they are in Chrome. This means that I am not calculating the row and column of the click properly. This affects grid.js
and puzzle.js
.
The 22 across black cell remains, and (1,1) is now black
There are two Javascript functions that use the click event:
Both of them use code like this:
var x = event.offsetX;
var y = event.offsetY;
Apparently the Firefox event model is different. I fiddled with it for several hours and couldn't make any headway.
Be able to print the puzzle in final published form, without the answers, so that I can just hand it to someone to solve.
All the methods should be static.
ME: Delete myfile
COMPUTER: Are you sure (Y/N)?
ME: Yes
COMPUTER: Are you really sure (Y/N)?
ME: Yes
COMPUTER: Are you really really sure (Y/N)?
ME: Yes
COMPUTER: (deletes myfile)
ME: Whoops, damn!
The problem is that I meant to delete myotherfile.
"Are you sure" messages shouldn't just ask you to confirm the action you want to perform, but the thing you want to perform the action on. The message should include the name of the thing:
COMPUTER: Are you sure you want to delete "myfile" (Y/N)?
ME: No
ME: Phew!
If a "suggest word" dropdown has been populated, it needs to be cleared before the edit word dialog is displayed.
User can enter a regular expression in the word, like [AEIOU]
for a vowel, or [^AEIOU]
for a consonant. This is extremely useful. But if user clicks OK while the regex is still in the input box, it overlays the text of the word.
I think it's good enough to just check for illegal characters in Javascript and open an alert if there are any.
If a grid or puzzle has been changed since the last save (or save as), the system should pop up a dialog box that makes the user confirm that they want to close without saving.
I have been careless about not using var
when declaring variables in javascript.
Sometimes fails to return a selection:
The README.md
file should provide just the following:
The rest of README.md
should be migrated to the github wiki.
Right now, I generate HTML that links to an SVG image. I have to post-process it by opening it in Microsoft Word, fiddling around with the positioning, then saving as PDF.
It would be much more straightforward to generate the PDF directly.
This would change:
System pops up a close without saving dialog
Output is generated, but no messages are seen.
In the edit word dialog, there is a suggest
button. Need to hook this up with a search of the word list for matches for the word, including its actual letters and the dots that represent missing letters.
Need a shorter name for ids. Maybe two-letter abbreviation for the dialog itself, then one letter suffix for individual elements.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.