Box Relatives

Thoughts about puzzles, math, coding, and miscellaneous

May 21, 2015
by Alex
0 comments

NPR Puzzle for 2015-05-17: Solving With Python

Here’s this week’s NPR puzzle:

Name a country with at least three consonants. These are the same consonants, in the same order, as in the name of a language spoken by millions of people worldwide. The country and the place where the language is principally spoken are in different parts of the globe. What country and what language are these?

Let’s see what the NLTK can do for us here.
Continue Reading →

April 30, 2015
by Alex
10 Comments

HTML5 Solver Feedback

At this point the HTML5 Crossword Solver is basically done, so I’m taking it out of its brief “beta” phase. There is now a recommended way to embed it in websites, like I’ve done above. And it will even automatically resize itself if you shrink your window — go ahead, try it out! Once again, I can’t thank Alex Shpak enough for coding all of this up.

But Alex S. can only take me so far. Now I need your help. I would really, really appreciate it if you would take five minutes or so and solve a puzzle in the solver, either the embedded one above, or one of your own JPZs at the official site. Is there anything in the interface you can’t live without? A “check” feature and timer come to mind, but maybe there’s something else. Are there any keyboard shortcuts that are missing? Do all the keys behave like you’d expect them to? The hope is that this will be everyone’s go-to interface for JPZ solving, so if there’s a reason you would be hesitant to use this, I want to know about it. (Or, if you just LOVE it, you can leave a comment saying that too.)

I can’t thank you enough for doing this. Together we can make this the best crossword solver there is!

April 18, 2015
by Alex
2 Comments

Introducing the Crossword Nexus HTML5 Solver

People seem to agree that JPZ files are the future of crossword solving. JPZs are extremely flexible, well-documented, and supported by the most popular crossword-making software. The problem thus far with JPZs has been solving them. XWord is great but only available for PCs. Crossword Solver is cross-platform, but many are somewhat less than enamored with its solving interface.

Somehow, the state of online solvers is even worse. If you want to embed puzzles in your website, what can you do? You can get a java version and deal with all the overhead and security risks that come there. You can buy Crossword Compiler and they’ll give you a license to use their HTML5 solver, but its interface isn’t any better than Crossword Solver’s, and it can’t handle all of the JPZ features you might want.

We decided to kill two birds with one stone. Introducing the Crossword Nexus Solver (currently in beta). It runs in your HTML5-compliant browser on any platform you may have (Windows, Mac, Linux, etc.) Just choose a .jpz file and it will render it for you, allowing you to solve it with an interface you’ll like. It can handle wacky JPZ files like Marching Bands no problem. And if you know any CSS you can modify it to run on your website — but we hope to have an “official” version like that out soon.

The best part? The code behind the solver is completely free, released under the BSD-3 License, and available on Github. If you know any Javascript, feel free to fork it and work on improving it. With the whole crossword community behind it, this solver will be improved much faster than it would with just one person. I’m really looking forward to seeing what this becomes.

Huge thanks to Alex Shpak, who did a great job doing the heavy lifting for the coding. Enjoy!

October 20, 2014
by Alex
1 Comment

Rot-13 Bookmarklet

Rot-13

Drag this link into the bookmark toolbar of Firefox or Chrome. When you highlight text in your browser and click the bookmarklet, it will automatically be encrypted (or decrypted) with Rot-13. Want to try it out? Highlight the following and click the bookmarklet.

Url, pbatenghyngvbaf, vg ybbxf yvxr vg’f jbexvat!

The code is based on the Rot-13 bookmarklet found here, with extra functionality for selecting more highlighted info from this StackOverflow answer.

September 14, 2014
by Alex
3 Comments

Puzzle Party Idea

Here in the Los Angeles area, puzzle-minded people like myself gather every two months for what we like to call a “puzzle party.” Several regulars will bring puzzles or games and we’ll solve them as a group. In the most recent one I presented a pairs solving puzzle (but one that’s doable solo) — you can download the PDF by clicking here.

Still, I got to thinking about what I might present for a future installment, and I came up with a game I’d like to call “Crosswordash.” I need some help perfecting the idea, though. If you’re interested in adding your thoughts, I’d love to hear them. Details after the jump …
Continue Reading →

August 14, 2014
by Alex
3 Comments

NPR Puzzle for August 10, 2014: solving with Python!

Here’s this past week’s NPR puzzle:

Name a well-known movie of the past — two words, seven letters in total. These seven letters can be rearranged to spell the name of an animal plus the sound it makes. What animal is it?

Brute-forcing this puzzle is easy but ineffective. We can get a list of movies from IMDB and see which of the seven-letter ones can anagram into two words. But you don’t want to do this, because it will force you to sift through a ton of results. Can we do better? (Yes, we can.)
Continue Reading →

July 7, 2014
by Alex
0 comments

Curriculum Vitae: Crazy Gin

Inspired by Todd McClary’s posts about the games he has created, I thought I’d share the only game I’ve ever come up with.

Crazy Gin
(Card game)

Two players are dealt seven cards each. One player plays gin rummy and the other player plays crazy eights. Both ignore the fact that the other person is playing by different rules. The only slight changes are

  1. The person playing gin always goes first (so that the first up card isn’t lost), and
  2. When the person playing gin discards an eight, she must declare a suit for the crazy eights player.

I invented this game in college one day, being unable to decide with a friend which of the two games to play. While a bit confusing (and frustrating!) at first due to the other player not behaving the way you would expect, it quickly becomes as easy as playing either game. Crazy Gin has not been *extensively* play-tested but it does appear fair. If, however, the person playing gin is very skilled, she may have an advantage. In this case the obvious handicap is to start the crazy eights player with only six cards.

January 18, 2014
by Alex
0 comments

A Quirk of Twitter

Let’s suppose for whatever reason I wanted to list my favorite TV stations, and I came up with this list:

cnn.com abc.com cbs.com nbc.com amc.com hbo.com fox.com

It’s not a long list — in fact, including spaces, it’s only 55 characters. Twitter’s character limit is 140 characters, so I should easily be able to tweet this, right? Wrong.
twit
Wait, what? I’m not just over the character limit, I’m WAY over it. How is that possible?

Well, it turns out this is a quirk of Twitter’s URL shortening code. Yes, if you have a long link like http://crosswordnexus.com/wiki/index.php?regex=*twit*&searchtype=simple&xmode=on&source=Wiki+%2B+Wiktionary&first=1 it will shorten it. But if you have a very short URL, it will actually lengthen it, sometimes by quite a bit. For instance, if I type “xkcd.com” into Twitter, it gets automatically changed to http://t.co/W1tPuAhAak, which is 22 characters long. In other words, an eight-character string almost triples in length when you type it in. Crazy, huh?