Live data from Hacker News

I found the best anagram in English (2017)

blog.plover.com

121–130 of 236 posts

Re: I found the best anagram in English (2017)

#121

I'm a non-coding lurker here, but the only thing that ever motivated me to write my own program was to solve the newspaper anagram puzzle, "Jumble", faster than my wife. I wrote it in Basic, then re-wrote it in assembly language, I forget when. Then in Fortran while home bound during the first summer of the pandemic - to atone for my past sin of neglecting to learn Fortran when I had a chance in the late 1960's.

I did the same thing! I stumbled upon an old ‘Al Zimmerman’ programming contest that involved creating wordsearch grids with the most words possible. I had a technique in mind, wrote it in BASIC. Then realized that was too slow. So I tried it in Java (which I’d heard was easy… it wasn’t… st least not to me). And then finally wrote it in C++, a language I found perfect in all respects. I actually ranked near the top in that contest, and I’ve been programming ever since. Ironically, I write programs to make puzzle books and I even have a Jumble knock-off on Amazon (sans cartoons… can’t draw worth a damn.)

Re: I found the best anagram in English (2017)

#122
post #6

That was pretty good for a one-word anagram. Back in the 1990s I wrote a program that generated anagrams for longer phrases and I was surprised to find these prescient ones: Saddam Hussein = He damns Saudis Charles Manson = Slasher con man David Letterman = Dead mitral vent Mary Jo Kopechne = My joke chaperon * Benito Mussolini = So, I bout Leninism Lee Harvey Oswald = Oe, why ever Dallas? * * "Chaperon" is a valid a…

Clint Eastwood = Old West Action is still my favorite serendiptious anagram. I also like the mathematically correct ELEVEN PLUS TWO = TWELVE PLUS ONE especially because it's also an numeric anagram 11 + 2 = 12 + 1

The Spanish translation of this is ONCE MAS CUATRO = CATORCE MAS UNO (11 + 4 = 14 + 1).

Re: I found the best anagram in English (2017)

#124
post #67

Earlier quoted context omitted.

Waiting for someone to post a 4-symbol APL version (which makes use of a language feature added by an eccentric hedge fund millionaire in 2002 and removed in 2017, to ensure nobody ever runs it).

According to GPT-4, an equivalent APL one-liner is: (⊢⌷⍨∘⍋∘≢¨)↑1<≢¨⊢⌸(⍋⊢)¨⎕NGET'/usr/share/dict/words'1

That doesn't work in Dyalog APL, comes back with RANK ERROR.

It's idiomatic to pick ⊃ the first result of ⎕NGET to get just the lines to work on, and not the other things like file encoding.

Then grade-up-right-train-each (⍋⊢)¨ is redunant, it's the same as grade-up-each ⍋¨

The grade is an array of which indices to take to put the argument in sorted order and I don't think it makes sense to group ⌸ by that since the grade isn't the same for different arrangements of letters, so the whole approach breaks down there. I think the words have to be sorted, e.g to pick out 'bat' and 'tab' as the same letters:

          {⍺, ≢⍵}⌸{⍵[⍋⍵]}¨words ← 'bat' 'dog' 'tab' 'cow' 'wok'

    abt 2
    dgo 1
    ...
Then 1
          {(1
Any with a 1 in the first column are anagrams, and 0 in the first column are not. And the other columns are indices into the wordlist where the matching words are, so words[1,3] picks out 'bat' and 'tab' and it's probably possible to filter rows with 1 in the first column:

          {⍵[;1]⌿⍵}{(1
and then drop the first column:

          1↓[2]{⍵[;1]⌿⍵}{(1
Then uhh filter out the zeros to avoid index error, and index into the word list, so:

          {words[⍵/⍨⍵>0]}¨⊂[2]1↓[2]{⍵[;1]⌿⍵}{(1
It can probably be done shorter and cleaner with more skill than I have. It's a lot quicker to execute than the PowerShell version I commented, but took a lot longer to code.

Re: I found the best anagram in English (2017)

#125

I'm a non-coding lurker here, but the only thing that ever motivated me to write my own program was to solve the newspaper anagram puzzle, "Jumble", faster than my wife. I wrote it in Basic, then re-wrote it in assembly language, I forget when. Then in Fortran while home bound during the first summer of the pandemic - to atone for my past sin of neglecting to learn Fortran when I had a chance in the late 1960's.

With respect, the moment you mentioned "re-wrote it in assembly language"...you stopped being a non-coder! :-) By the way, very cool use of technolgoy for somewhat everyday things (solving puzzles).

Re: I found the best anagram in English (2017)

#126
There's something magically target-rich about anagrams.

My full first, middle and last name is long enough with common letters that there are several uproariously serendipitous and embarrassingly obscene (even for me) anagrams of my full name.

So bad I would never post them here. Much worse than you could possibly imagine. Take my word for it: you don't want to know.

The only advice I'll share is that parents should carefully screen their baby names with the advanced anagram server, and choose short names with unusual letters that have lower chances of backfiring.

https://wordsmith.org/anagram/advanced.html

Re: I found the best anagram in English (2017)

#128

I'm a non-coding lurker here, but the only thing that ever motivated me to write my own program was to solve the newspaper anagram puzzle, "Jumble", faster than my wife. I wrote it in Basic, then re-wrote it in assembly language, I forget when. Then in Fortran while home bound during the first summer of the pandemic - to atone for my past sin of neglecting to learn Fortran when I had a chance in the late 1960's.

I did similar for a newspaper puzzle unscrambler, pushing to rewrite it in lower level languages (PowerShell then C# then Rust) and changing algorithm (from sort letters, to precompute lookup hashtable of sorted letters, to multiply prime numbers one for each alphabet letter to drop the overhead of sorting, to lookup hash of those, to sorting the integer results into an array to do a binary search through and jump to the matching offset in an answers array and inlining those in the code) until it was near enough instant.

... and I don't use it, because unjumbling the word myself is satisfying, but typing the letters into a computer and getting the answer isn't.

Re: I found the best anagram in English (2017)

#129
post #87

Earlier quoted context omitted.

Do pay attention. You wrote "Prior to Perl doing this was painful.". I highlighted how you contradicted the author's claim that it was easy to do using awk. Awk existed long before Perl.

What’s the word for when snark backfires?

snark backfires = barf earns kicks

Re: I found the best anagram in English (2017)

#130

I'm a non-coding lurker here, but the only thing that ever motivated me to write my own program was to solve the newspaper anagram puzzle, "Jumble", faster than my wife. I wrote it in Basic, then re-wrote it in assembly language, I forget when. Then in Fortran while home bound during the first summer of the pandemic - to atone for my past sin of neglecting to learn Fortran when I had a chance in the late 1960's.

We regret to inform you that you are now a former non-coder.
Post reply on HN