This project aims to provide a simple method for creating and sharing custom strands boards based on the NYT game strands. In my spare time, I noticed that while humans could create a strands board easily, it might be challenging for an algorithm to do so: automatically generating a legal board given a list of words totaling 48 letters.
This website uses a Django backend, with a pure javascript frontend deployed on Heroku. Beyond the four main view pages for game creation (home, create, about, play), there are three endpoints exposed (generate, save, url_check), used for obvious purposes. In the database, each custom game created from save are identified with a unique url, enforced by url_check. Then, upon pattern matching in the play url, the appropriate game is fetched and displayed.
In addition, to support users, a CustomUser model is created (extending Django's AbstractBaseUser for data security), and a one-to-one Profile model is created. The profile is identified using a unique email, and a display_name is used for displaying on the web. To support authors, a Profile object is stored on each StoredGame, representing the author.
For completions, a join table is used, joining Profile and StoredGame objects. This is for future meta-data to be able to be stored, potentially fields like time to completion, likes, dislikes, etc. When a non-user completes a game, simply a field in the corresponding StoredGame object is updated. Having completions allows for statistics to be displayed for the StoredGame and during random play, for games not to be shown again.
This schema allows for complex queries, like retrieving all anonymous and profiled completions to rank authors. The following SQL query retrieves the authors with the most total completions over all public games and is an example of how the above schema can be used for data insights. Toggle PostgreSQL Query
WITH games AS (
SELECT id, anonymous_completions, author_id
FROM cstrandsapp_storedgame
WHERE "order" > -1 AND is_archive = False
),
completions AS (
SELECT stored_game_id, COUNT(*) AS count
FROM cstrandsapp_completion
GROUP BY stored_game_id
),
total AS (
SELECT
games.author_id,
SUM(games.anonymous_completions) + COALESCE(SUM(completions.count), 0) AS total_sum
FROM games
LEFT JOIN completions
ON games.id = completions.stored_game_id
GROUP BY games.author_id
)
SELECT
display_name,
url,
total_sum
FROM total
JOIN cstrandsapp_profile
ON cstrandsapp_profile.id = total.author_id
ORDER BY total_sum DESC
LIMIT 5;
The goal of the creation of the custom strands is to be user-friendly, meaning the creator should need only to provide what words relate to the theme and spangram, and the tedious letter placement should be done automatically. The following algorithm is called about pinging the generate endpoint and is developed as a result of countless iterations.
Donations help cover the $15 a month fee for hosting a backend for this website.
Thank you to the following people for donating to Custom Strands:
Authenticated users see no inline ads. Password Reset implemented.
Archive Quick Navigate (for authenticated users)
Manual Mode Creation of Puzzles. Modularity of displayed table in create page, manual mode, MANUAL_DICT state. Added errors and warnings to create page for better usability. Play Random now does a random choice weighted by normalized completions. Archive games have their completions divided by 10 in the weighting to give creators more opportunity.
Updated Top Creator Statistic to get total completions over all authored games
Archive now has original boards from NYT games, NYT authors, automatic profiles, updated titles.
Updated Player: Click + Click interation, Multicolor mode for sharing: ⭐ for spangram, colors for regular words. Feature List. How to play modal.
Users: Public games, profiles, editing profiles, completions, random_play, create page database optimizations / changing user flow, statistics.
Switched to Uppercase letters, Updated "Create" UI, Backtracking in Play, Theme Card v2, Donations Implemented, Hints
Archive created for past strands, Change Log Created, Sharing
Fixed database bugs, added "auto-correct" to eliminate "Right word, wrong place", About Page, Better "create" page input handling (no spaces in url, no blank words), logo created (credit Bob Qian), Confetti (idea Jason Lin)
Deployment to web, https SSL config, create functionality, play functionality, canvas objects (credit: Sam Borremans).
customstrandsnyt.com is not affilliated with the New York Times, and is meant as an educational/personal project.
Hate the inline ads? Create a free account
Find a bug / Have any feedback / Business Inquiries? Email it to customstrandsnyt@gmail.com
Please consider donating to help cover the $15/month server costs :)