## ← 06-20 Anchors Solution

• 1 Follower
• 31 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=HURbpnrZ_qo" data-team="udacity"></div> ``` 1 Language

Showing Revision 1 created 06/29/2012 by Amara Bot.

1. The answers are for this anchor the prefix has got to be one character--the A.
2. This anchor--we can't cover another anchor, so it's got to be zero.
3. This anchor--we conclude this if we want, but we can't go on to the other anchor, so it's zero to one.
4. Here we've got to include the D but nothing else, so it's 1.
5. Now, there's one more thing about anchors I want to cover,
6. which is how we deal with the words in the other direction.
7. For these five anchors there are no letters in the other direction.
8. So these are completely unconstrained.
9. We say that any letter can go into those spots.
10. But in these two anchors, there's adjacent letters,
11. and it would be okay. We could form a word going in this direction.
12. But we can do that only if we can also form a word going in this direction.
13. Let's say there are no more. This is either the edge of the board or the next row is all blanks.
14. Then we can say, well, what letters can go here?
15. Only the letters that form a word when the first letter is that word and the second letter is U.
16. In our dictionary, it turns out that that possibility is the set of letters M, N, and X.
17. MU, NU, and XU are all words in our dictionary, believe it or not.
18. The Scrabble dictionaries are notorious for having two- and three-letter words
19. that you've never heard of.
20. Similarly here--what are two-letter words that end in Y?
21. It' the set M, O, A, B. You've probably heard of most of those.
22. When we go to place words on a particular row,
23. we can pre-compute the crosswords and make that be part of the anchor.
24. What we're going to do is have a process that goes through, finds all the anchor points,
25. and finds all the sets of letters--whether it's any letter for these five anchors,
26. or whether it's a constrained set of anchor letters for these two anchors.
27. Sounds complicated, but we can make it all work.
28. Let me say that once you've got this concept, the concept of the anchor sets
29. and the cross words, then basically we're done. We've done it all.
30. We can handle a complete board no matter how complicated, and we can get all the plays.
31. It's just a matter of implementing this idea and then just fleshing it out.