What Do You Do With A Genteel Sailor?

Josh Randall, Katherine Thompson, Jon Orwant

SOLUTION:

This puzzle is in three parts. In the first part, the solvers are presented with three crochet patterns, which when crocheted shows a grid of symbols that are in an obscure programming language. In the second part, solvers figure out and solve a programming puzzle to arrive at an ISBN and a page number. On that book's page they'll find the answer.

### PART 1: The crocheting puzzle.

There are three crochet patterns, with directions in the American (as opposed to the British/Australian) style. Anyone who knows how to crochet sould immediately recognize the syntax. Should no one who crochets be working on the puzzle, searching on google for keywords such as "MC chain turn sc ch hook next fo" provides topical links.

The crocheting itself could be done:

• in full with graph paper and pencil
• in full with crochet hook and yarn (expected time to actually crochet full pattern -- 300 person-hours)
• in full with computer (a few hours to write a program)
• in part until symbols are found, and then symbol patterns searched for (partial backsolve) to quickly get the end result.

One way or another, a graphical representation of the patterns (a grid of symbols) results. See virtual solutions for 1 (pdf png), 2 (pdf png), and 3 (pdf png). Here is the perl program used to generate the PDFs (by virtually crocheting the patterns).

This grid of symbols constitutes the next portion of the puzzle, which brings us to:

### PART 2: The programming puzzle.

This is in a programming language called Befunge. Befunge is stack-based, which isn't surprising. It's a two-dimensional language, which is. The instruction pointer moves character by character around the page. "v" moves the pointer down; "^" moves the pointer up; "<" left, ">" right. The instruction pointer keeps moving in its current direction until it's redirected, and starts out at the upper left hand corner of the page, moving right. A loop is just that -- a visible loop on the page.

There are actually two Befunges: Befunge-93 and Befunge-98. The three Befunge programs below work with either. The puzzle is constructed so that someone who doesn't recognize Befunge can decode the answer anyway; people who do recognize Befunge could run an interpreter. (I used an interpreter, the Language::Befunge Perl module available from http://search.cpan.org, to verify that my programs produce the correct answers.)

First, the warmup. Everyone will see that this is "hello" backwards:

``` "olleh",,,,,,@
```

This prints "hello". The " character toggles string mode; the letters are pushed onto the stack; the commas push them off the stack, and @ ends the program.

Second, the slightly harder warmup. They have seen "hello", so casual inspection should reveal the letters "world!" plus those curious extra "v"s. And sure enough, this prints "world!":

``` "!"vv"w"<
@"", ,<"
d,  ,o
">,,^"
>"lr"^
```

They'll see some symmetries in the other characters, along the diagonals. After this, people should realize that they're looking at a two-dimensional programming language.

Third, the real puzzle, which crosses over itself lots of times, and uses no letters of the alphabet at all, just punctuation and "5".

```  v v<        v      -/55     <  v+/<
-/                 >v        5  5
,5       v5<       *         5  5
5       >5*+5+55/+55/+,  ^  /  *
+         5       55        +  +
>55*55*+55/-55/-  v   *        5  5
55        +         +        5  5
*5        *     ,   5        /  +
5*        5     "   5        +  5
55        >++,,"-",^/        5  5
*5   >+       "-",, -55+55+*55/+^
+^,+/55+*55  *55,-/ 55-/5<   + v<
5                   5    5   5 5-
5               5   /    +   5 5/
/    +     ^,+/55  <-    *   + +5
+    *          *   ,    5   * 55
,    5      >  55/+^>55*5^v*+5 <-
>55*5^      ^+/55<        5  5  /
*         5  /  5
v ,,,,   +/55+/55++         <  -
>555**5555***+.@  >^           >5 ^
```

The fives are used to build up characters via their ASCII values and print them out intermittently (whenever you see a comma, that's a character being printed out). People will see strings like 55*55*+ and figure out that it's reverse Polish notation. If they understand that, this subpuzzle will be straightforward until the very end: the last line, which uses a new character: the period, which pops the stack and prints the resulting number. In this case, that's (5*5*5)+(5*5*5*5), or 750. This program prints:

```0-596-00313-7page750
```

### PART 3: The book puzzle.

0-596-00313-7 is the ISBN of a book called the Perl Cookbook (second edition, published in September by O'Reilly). Page 750 contains the following text:

```  18.14.3 Discussion

A single SOAP server may offer remote access to the methods of many
classes. A client identifies the class upon which it wishes to invoke
methods with the uri parameter. The hostname in the argument is
irrelevant; only the path portion (the class name) matters. For
example, these two URIs are equivalent:

http://modacrylic.clue.com/GimpyMod
http://weenies.mit.edu/GimpyMod
```

The answer is "modacrylic". (The second line was the price I had to pay for getting a clue inserted into an O'Reilly book.)

The book may be reprinted between now and January, but the contents of page 750 will not change.

The ISBN is only for the second edition. Quantum Books is likely to have a copy, and possibly the MIT Coop as well. We are requesting a copy for the MIT libraries as well, and will have an active web page on the second URL (http://weenies.mit.edu/GimpyMod) as well, containing the following text:

```Greetings MIT weenies
You have gone too far
Must go back one line
Right before clue.com
```

Which should be sufficient to get them to call in the answer they have already found.

programming puzzle written by Jon Orwant

crocheting puzzle written by Joshua Randall and Katherine Thompson

commissioned and edited by Joshua Randall