Add files via upload
This commit is contained in:
parent
b838972ef9
commit
eefdd7dbc3
@ -4,6 +4,8 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div align=\"right\">Peter Norvig, Nov. 2017</div>\n",
|
||||
"\n",
|
||||
"# Bad Grade, Good Experience\n",
|
||||
"\n",
|
||||
"Recently I was asked a question I hadn't thought about before: \n",
|
||||
@ -12,7 +14,7 @@
|
||||
"\n",
|
||||
"I've forgotten most of my assignments, but there is one I do remember. It was something like this:\n",
|
||||
"\n",
|
||||
"## The Concordance Assignment\n",
|
||||
"# The Concordance Assignment\n",
|
||||
"\n",
|
||||
"> *Using the [`Snobol`](http://www.snobol4.org/) language, read lines of text from the standard input and print a *concordance*, which is an alphabetized list of words in the text, with the line number(s) where each word appears. Words with different capitalization (like \"A\" and \"a\") should be merged into one entry.*\n",
|
||||
"\n",
|
||||
@ -31,7 +33,11 @@
|
||||
"* When the program ends, the Snobol interpreter automatically\n",
|
||||
"prints the values of every variable, sorted alphabetically, as a debugging aid.\n",
|
||||
"\n",
|
||||
"That means I could do away with the `dict` and `array` data structures, eliminating steps 1, 3, 4, and 5, and just do step 2! I ended up with a program similar to the following, but to avoid having to explain Snobol syntax, I use all Python syntax ecept for the `'$word'` indirection:"
|
||||
"That means I could do away with the `dict` and `array` data structures, eliminating steps 1, 3, 4, and 5, and just do step 2! \n",
|
||||
"\n",
|
||||
"# The Concordance Solution\n",
|
||||
"\n",
|
||||
"I ended up with a program similar to the following, but to avoid having to explain Snobol, here I show Python syntax ecept for the `'$word'` indirection:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user