summaryrefslogtreecommitdiff
path: root/info/challenges/aro-bend/exercise.004
blob: a84485d9897698a1ff3f66521d973e2327fb6cc9 (plain)
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
[Exercises 4,5,6,7 were originally posted together on 4 Nov 91]
Date: Mon 4 Nov 91 16:42:44-EST
From: Michael Downes <MJD@MATH.AMS.COM>
Subject: Around the bend #2
To: info-tex@shsu.edu

The statement of purpose in `Around the bend' #1 said something about
finding the `best solution', but failed to define what `best' should
mean when comparing pieces of TeX code. I'll start by throwing out
a few ideas.

Simplicity. A good solution gets hold of the essential idea of the
problem and attacks it directly, rather than beating around the bush
and resorting to separate clauses to handle troublesome subcases.

Economy. if two solutions compare equal in other respects, then the
better solution is the one that uses less of TeX's resources (main
memory, hash table, string pool, and so forth). Therefore I
(immodestly) say that my solution to Exercise 1 was ever so slightly
better than the other two given, because it avoided introducing any
auxiliary macros that were not included in the original statement of
the problem.

Robustness. If a solution only works under limited friendly
circumstances, and otherwise blows up with an error message, that's not
good. My solution to Exercise 2 was flawed in this respect, since D.A.
found a test case that caused it to go wrong.

***********************************************************************
*** Exercise 4 (essay):

What should `best' mean when comparing solutions to an `Around the
bend' exercise? What qualities of a good solution are most important?
Why? How can they be objectively measured? (Or can they?) On the
negative side, what qualities indicate an inferior solution?

***********************************************************************

[Exercise 5 moved to exercise.005]
[Exercise 6 moved to exercise.006]
[Exercise 7 moved to exercise.007]

Send answers to:

Michael Downes      mjd@math.ams.com (Internet)

A summary will be posted Tuesday, December 4, 1991. However, because of
the difficulty of E7, I will probably procrastinate on posting the
solutions for that exercise until the first or second week of December.

Table of special characters, to verify accurate transmission:

ASCII 33:  ! exclamation point       ASCII 60:  < left elbow
ASCII 34:  " double quote            ASCII 61:  = equals sign
ASCII 35:  # number/pound sign       ASCII 62:  > right elbow
ASCII 36:  $ dollar sign             ASCII 63:  ? question mark
ASCII 37:  % percent sign            ASCII 64:  @ at sign
ASCII 38:  & ampersand               ASCII 91:  [ left square bracket
ASCII 39:  ' right quote/apostrophe  ASCII 92:  \ backslash
ASCII 40:  ( left parenthesis        ASCII 93:  ] right square bracket
ASCII 41:  ) right parenthesis       ASCII 94:  ^ circumflex/hat/caret
ASCII 42:  * star/asterisk           ASCII 95:  _ underscore
ASCII 45:  - hyphen                  ASCII 96:  ` left quote
ASCII 47:  / slash                   ASCII 123:  { left curly brace
ASCII 58:  : colon                   ASCII 124:  | vert bar
ASCII 59:  ; semicolon               ASCII 125:  } right curly brace
                                     ASCII 126:  ~ tilde