forked from johannesgerer/jburkardt-f
-
Notifications
You must be signed in to change notification settings - Fork 1
/
puzzles.html
376 lines (337 loc) · 11.1 KB
/
puzzles.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<html>
<head>
<title>
PUZZLES - FORTRAN90 Programs Useful for Puzzles
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
PUZZLES <br> FORTRAN90 Programs Useful for Puzzles
</h1>
<hr>
<p>
<b>PUZZLES</b>
is a directory of FORTRAN90 programs which
were used to solve puzzles.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>PUZZLES</b> is available in
<a href = "../../f_src/puzzles/puzzles.html">a FORTRAN90 version</a> and
<a href = "../../m_src/puzzles/puzzles.html">a MATLAB version.</a>
</p>
<h3 align = "center">
Related Programs:
</h3>
<p>
<a href = "../../cpp_src/anagram/anagram.html">
ANAGRAM</a>,
a C++ program which
determines anagrams of a string,
by James Cherry;
</p>
<p>
<a href = "../../c_src/life_opengl/life_opengl.html">
LIFE_OPENGL</a>,
a C program which
uses OpenGL to display the evolution of John Conway's "Game of Life",
by Simon Green.
</p>
<p>
<a href = "../../cpp_src/lights_out_opengl/lights_out_opengl.html">
LIGHTS_OUT_OPENGL</a>,
a C++ program which
sets up a "Lights Out" game and allows the user to solve it,
using the OpenGL graphics window.
</p>
<p>
<a href = "../../f_src/subanagram/subanagram.html">
SUBANAGRAM</a>,
a FORTRAN90 program which
finds words which are anagrams formed from some of the letters
of a given master word.
</p>
<p>
<a href = "../../m_src/sudoku/sudoku.html">
SUDOKU</a>,
a MATLAB library which
manipulates and solves Sudoku problems.
</p>
<p>
<a href = "../../f_src/wordsnake/wordsnake.html">
WORDSNAKE</a>,
a FORTRAN90 program which
rearranges a list of words so that
they have maximum overlap;
</p>
<h3 align = "center">
Source Code
</h3>
<h3 align = "center">
ASCENDOGRAM
</h3>
<p>
The ascendogram puzzle is posed in
<a href = "../../fun/puzzles/ascendogram_puzzle.html">
The Ascendogram Puzzle</a>. To answer the question, a program
was written, which searched a text file.
<ul>
<li>
<a href = "ascendogram.f90">ascendogram.f90</a>, the source code;
</li>
<li>
<a href = "ascendogram.sh">ascendogram.sh</a>,
commands to compile the source code;
</li>
<li>
<a href = "ascendogram_output.txt">ascendogram_output.txt</a>,
printed output from the program
</li>
<li>
<a href = "../../datasets/words/wordlist.txt">wordlist.txt</a>,
the word list that was searched.
</li>
<li>
<a href = "strict.txt">strict.txt</a>,
the strict ascendograms that were found.
</li>
<li>
<a href = "loose.txt">loose.txt</a>,
the loose ascendograms that were found.
</li>
</ul>
</p>
<h3 align = "center">
AMSTERDAM
</h3>
<p>
Textropolis is an iPhone application which presents you with the name
of a city and asks for as many words as you can form, using only the
letters in the city name. It also wants the words to be at least
4 letters long. Vivian is desperate to get all 130 words that that
game claims you can make. She's hoping to see fireworks over the
Amsterdam cityscape!
<ul>
<li>
<a href = "amsterdam.f90">amsterdam.f90</a>,
a program to find subanagrams of AMSTERDAM.
</li>
<li>
<a href = "amsterdam.sh">amsterdam.sh</a>,
commands to compile and run the program.
</li>
<li>
<a href = "amsterdam_output.txt">amsterdam_output.txt</a>,
printed output from the program
</li>
<li>
<a href = "amsterdam.txt">amsterdam.txt</a>,
a list of some words formed from AMSTERDAM, found by the program.
</li>
<li>
<a href = "amsterdam_by_hand.txt">amsterdam_by_hand.txt</a>,
a list of some words formed from AMSTERDAM, found "by hand".
</li>
<li>
<a href = "../../datasets/words/wordlist.txt">wordlist.txt</a>,
the word list that was searched.
</li>
</ul>
</p>
<h3 align = "center">
FOOTBALL_WAYS
</h3>
<p>
The football score puzzle is posed in
<a href = "../../fun/puzzles/football_puzzle.html">
The Football Puzzle</a>. To answer the question, a program
was written.
<ul>
<li>
<a href = "football_ways.f90">football_ways.f90</a>, the source code;
</li>
<li>
<a href = "football_ways.sh">football_ways.sh</a>,
commands to compile the source code;
</li>
<li>
<a href = "football_ways_output.txt">football_ways_output.txt</a>,
printed output from the program, which listed the answers.
</li>
</ul>
</p>
<h3 align = "center">
KETEL ONE
</h3>
<p>
The following challenge appeared in an advertistement in
the New York Times, 14 June 2007:
<blockquote><i>
"Dear Ketel One Drinker: Can you make one hundred words, of four letters
or more, from the letters in Ketel One Vodka?"
</i></blockquote>
To answer the question, a program was written, which searched
a text file.
<ul>
<li>
<a href = "ketel_one.f90">ketel_one.f90</a>, the source code;
</li>
<li>
<a href = "ketel_one.sh">ketel_one.sh</a>,
commands to compile the source code;
</li>
<li>
<a href = "ketel_one_output.txt">ketel_one_output.txt</a>,
printed output from the program
</li>
<li>
<a href = "../../datasets/words/wordlist.txt">wordlist.txt</a>,
the word list that was searched.
</li>
<li>
<a href = "ketel_one.txt">ketel_one.txt</a>,
the 514 "subanagrams" that were found by the program. Some of
these are proper names, or dubious words.
</li>
<li>
<a href = "ketel_one_jtb.txt">ketel_one_jtb.txt</a>,
a list of 100 subanagrams of "Ketel One Vodka", made "by hand",
by a separate researcher.
</li>
<li>
<a href = "ketel_one_byhand.txt">ketel_one_byhand.txt</a>,
a list of 202 subanagrams of "Ketel One Vodka", made "by hand",
that is, without electronic or printed aids.
</li>
<li>
<a href = "ketel_one_anagrams.txt">ketel_one_anagrams.txt</a>,
a list of anagrams of "Ketel One Vodka" found by James Cherry's
<b>anagram</b> program.
</li>
</ul>
</p>
<h3 align = "center">
LOCK
</h3>
<p>
The "lock" puzzle is posed in
<a href = "../../fun/puzzles/lock_puzzle.html">The Lock Puzzle</a>.
My nephew Logan called to say he was stuck on a puzzle in a video game.
He was facing a lock which had four dials, and he needed to change the
current combination to a specified one. The trick was that the dials
affected their neighbors. Turning dial 1 would turn dial 2 the same amount.
Turning dial 2 or dial 3 also turned the immediate left and right neighbors,
while dial 4 also made dial 3 turn. This complication made it difficult
to see how to go from a combination of, say, 1492, to a target of 1234.
<ul>
<li>
<a href = "lock.f90">lock.f90</a>,
the source code for a program that simulates the lock problem with
random start and target;
</li>
<li>
<a href = "lock_solve.f90">lock_solve.f90</a>,
a program that accepts a current and desired combination, and
reports the amount to advance each dial to achieve the target.
</li>
</ul>
</p>
<h3 align = "center">
THIRTY ONE
</h3>
<p>
The "thirty one" puzzle is posed in
<a href = "../../fun/puzzles/thirty_one_puzzle.html">
The Thirty One Puzzle</a>. A tableau of 24 cards is laid out, consisting
of 4 copies of each number from 1 to 6. Two players alternate in selecting
a card from the tableau. As a card is chosen by either player, its face
value is added to the total. If a player's choice causes the total to
reach exactly 31, that player wins. If a player's choice increases the
total past 31, the game is a draw. The program given here allows the
user to play the first player, which the program plays the second player.
The program analyzes its next move to see if it has a win, or if its move
would allow the user to win immediately. The program was written by
Yuen-Yick Kwan.
<ul>
<li>
<a href = "thirty_one.f90">thirty_one.f90</a>, the source code;
</li>
<li>
<a href = "thirty_one.sh">thirty_one.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
UNIGRAM
</h3>
<p>
The unigram puzzle is posed in
<a href = "../../fun/puzzles/unigram_puzzle.html">
The Unigram Puzzle</a>. To answer the question, a program
was written, which searched a text file.
<ul>
<li>
<a href = "unigram.f90">unigram.f90</a>, the source code;
</li>
<li>
<a href = "unigram.sh">unigram.sh</a>,
commands to compile the source code;
</li>
<li>
<a href = "unigram_output.txt">unigram_output.txt</a>,
printed output from the program
</li>
<li>
<a href = "../../datasets/words/wordlist.txt">wordlist.txt</a>,
the word list that was searched.
</li>
<li>
<a href = "unigram.txt">unigram.txt</a>,
the unigrams that were found.
</li>
</ul>
</p>
<h3 align = "center">
ZERO-ONE
</h3>
<p>
The zero-one puzzle is posed in
<a href = "../../fun/puzzles/zero_one_puzzle.html">
The Zero One Puzzle</a>. To test the proposed solutions, a program
was written.
<ul>
<li>
<a href = "zero_one.f90">zero_one.f90</a>, the source code;
</li>
<li>
<a href = "zero_one.sh">zero_one.sh</a>,
commands to compile the source code;
</li>
<li>
<a href = "zero_one_output.txt">zero_one_output.txt</a>,
printed output from the program, which tested the proposed solutions.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../f_src.html">
the FORTRAN90 source codes</a>.
</p>
<hr>
<i>
Last revised on 08 May 2011.
</i>
<!-- John Burkardt -->
</body>
</html>