-
Notifications
You must be signed in to change notification settings - Fork 26
/
poetry.html
81 lines (58 loc) · 2.23 KB
/
poetry.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
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<title>Puzzle: Python Poetry</title>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<p class="subtle"><a href="/">« Boston Python puzzles</a></p>
<h1>Python Poetry</h1>
<p>You find yourself in a dark, wet cave. There is a heavy door with a mushroom growing on it. (Or is that an ear?)</p>
<p>Nailed to the door is a poem by Emily Dickinson:</p>
<pre>
'''a narrow fellow in the grass
occasionally rides;
you may have met him, did you not,
his notice sudden is.
the grass divides as with a comb,
a spotted shaft is seen;
and then it closes at your feet
and opens further on.
he likes a boggy acre,
a floor too cool for corn.
yet when a child, and barefoot,
i more than once, at morn,
have passed, i thought, a whip-lash
unbraiding in the sun,
when, stooping to secure it,
it wrinkled, and was gone.
several of nature's people
i know, and they know me;
i feel for them a transport
of cordiality;
but never met this fellow,
attended or alone,
without a tighter breathing,
and zero at the bone.'''
</pre>
<p>Below the poem is a riddle:</p>
<pre>
say([56,38,44,56,29])
</pre>
<p>And below that, a note:</p>
<pre>
# hint: 'zebra' = [1,56,7,29,42]
</pre>
<p>1) Write a program that solves the riddle.</p>
<p>What do you say?</p>
<p>2) Write a program that shows the mapping for all letters.</p>
<p>Which letters are available, i.e. have unique non-zero values? </p>
<p>3) Write a program that generates all such riddles based on this poem.</p>
<p>What is the longest word that is a solution to a riddle based on this poem?
(useful: <a href="http://en.wikipedia.org/wiki/Words_%28Unix%29">Words (Unix)</a>)</p>
<h2>Solutions</h2>
<ul>
<li>Matt Page-Lieberman's solution is <a href="https://github.com/BostonPython/puzzles/blob/gh-pages/solutions/jotaemei/pythonpoetry.py">pythonpoetry.py</a></li>
<li>Aaron Hill's solution is <a href="https://github.com/BostonPython/puzzles/blob/gh-pages/solutions/Aaron1011/poetry.py">poetry.py</a></li>
<li>Josh McGrath's solution is <a href="https://github.com/BostonPython/puzzles/blob/gh-pages/solutions/joshmcgrath08/poetry.py">poetry.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>