Add files via upload

This commit is contained in:
Peter Norvig
2021-09-01 22:56:07 -07:00
committed by GitHub
parent 57845a9713
commit e591e2ff79

View File

@@ -594,7 +594,7 @@
"Here's my idea:\n",
"\n",
"1. Try every pangram letterset, but do some precomputation to make `game_score` much faster:\n",
" - Compute the `letterset` and `word_score` for each word in the word list.\n",
" - Compute the `letterset` and `word_score` for each word in the word list. \n",
" - Make a table of `{letterset: total_points}` giving the total points of all words with a given letterset. \n",
" - I call this a **points table**.\n",
" - These calculations are independent of the honeycomb, so are done once, not 55,902 times. \n",
@@ -721,7 +721,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The letterset `'AGLM'` gets 8 points (7 for AMALGAM and 1 for GLAM). `'ACEIORT'` gets 31 points (17 for CACCIATORE and 14 for EROTICA). `'AEGM'` gets 1 for GAME and `'AEGLMPX'` gets 15 for MEGAPLEX. The other 59 lettersets have no words, no points.\n",
"The letterset `'AGLM'` gets 8 points (7 for AMALGAM and 1 for GLAM). `'ACEIORT'` gets 31 points (17 for CACCIATORE and 14 for EROTICA). `'AEGM'` gets 1 for GAME and `'AEGLMPX'` gets 15 for MEGAPLEX. \n",
"\n",
"Let's make sure the new `top_honeycomb2` function works as well as the old one:"
]
@@ -945,11 +945,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This says that `top_honeycomb3` examined 8,084 honeycombs; an almost 7-fold improvement over the 55,902 examined by `top_honeycomb2`.\n",
"`top_honeycomb3` examined 8,084 honeycombs; an almost 7-fold reduction from the 55,902 examined by `top_honeycomb2`.\n",
"\n",
"# 9: Fancy Report\n",
"\n",
"I'd like to see the actual words that each honeycomb can make, and I'm curious about how the words are divided up by letterset. Here's a function to provide such a report. I remembered that there is a `fill` function in Python (it is in the `textwrap` module) but this report turned out to be a lot more complicated than I anticipated. I guess it is difficult to create a practical extraction and reporting tool. I feel you, [Larry Wall](http://www.wall.org/~larry/)."
"I'd like to see the actual words that each honeycomb can make, and I'm curious about how the words are divided up by letterset. Here's a function to provide such a report. This report turned out to be a lot more complicated than I anticipated. I guess it is difficult to create a practical extraction and reporting tool. I feel you, [Larry Wall](http://www.wall.org/~larry/)."
]
},
{
@@ -1352,7 +1352,7 @@
" 537 words                         1,179 words \n",
" <br>50 pangrams &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 86 pangrams\n",
" <br>3,898 points &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 8,681 points\n",
" <br> &nbsp; RETAINING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENTERTAINERS\n",
" <br> &nbsp; &nbsp; RETAINING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENTERTAINERS\n",
"</center>"
]
},