-
Notifications
You must be signed in to change notification settings - Fork 26
/
mirror.html
74 lines (55 loc) · 1.86 KB
/
mirror.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<title>A is for Anaconda</title>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<p class="subtle"><a href="/">« Boston Python puzzles</a></p>
<h1>A is for Anaconda</h1>
<p>Alphabetizing isn't just useful. It's fun!</p>
<p>Every kid learns that A is for Apple ... and Z is for Zebra.</p>
</p>But not every kid learns the mirror-alphabet words:</p>
<pre>
A is for Anaconda
B is for Bathtub
C is for Comic
...
Z is for Zizz
</pre>
<p>Not only are the first letters of each word alphabetic, so are the last
letters!</p>
<p>Unfortunately, you can't complete this list: no word in English begins and
ends with X.</p>
<p>But what if you shift the alphabet by one letter for the ending?</p>
<pre>
A is for Absorb
B is for Byronic
C is for Caryatid
...
X is for Xenophoby
Y is for Yez
Z is for Zebra
</pre>
<p>You'll find that this won't work either. How about shifting the end letter
alphabet by 2?</p>
<pre>
A is for Antihemorrhagic
B is for Blindfold
C is for Capstone
...
Y is for Yoga
Z is for Zimb
</pre>
<p>That fails, too! In fact, there is only one mirror-alphabetic ordering that
works for English.</p>
<p>1) Write a program that generates a valid mirror-alphabet word list.</p>
<p>2) What is the one word that always sticks out like a sore thumb in your
mirror-alphabet list if you try to limit the list to 4-letter words? (Hint:
It's a style of handwriting.)</p>
<p>BONUS: Make a mirror-alphabet word list that has the least weird words.
(<a href="http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists">These might be useful</a>.)</p>
<h2>Solutions</h2>
<ul>
<li>Andrew Ross's solution is <a href="https://github.com/BostonPython/puzzles/blob/gh-pages/solutions/asross/mirror.py">mirror.py</a></li>
</ul>
<p>If you have a solution you'd like to share see the <a href="solutions.html">Solutions page</a> for instructions.</p>