Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Dimity Jones in Puzzle Castle: An Electronic Escape Novel (github.com/larryboyko)
110 points by larryboyko on April 11, 2024 | hide | past | favorite | 33 comments
_Dimity Jones In Puzzle Castle: An Electronic Escape Novel in Eighty-Nine Ciphertexts_ is a (mostly) fictional story, contained in a single text file, that requires the reader to solve puzzles as they go along, and to use each chapter's solution as a key to decipher the next.

Think: escape room in the form of a novel.

A computer, and rudimentary coding skills in a language of your choice, will be indispensable for performing the transformations -- and might help with the solving too!

My wife, the author, passed away five years ago. This is not the last thing she wrote, but it is the most unusual, unapproachable, and personal of her major works. It is also, as the only novel of hers that I cannot breeze through in an afternoon (and despite my unflattering appearance in it), my favorite.

Though _Dimity Jones_ was left unfinished, and perhaps abandoned, at the time of my wife's death, its elements were all there, on her hard disk, awaiting only a final compiling. My contribution to this text has therefore been little more than that of an occasional copyeditor (my wife was a meticulous speller and self-proofreader) and playtester.

Before releasing this work more widely, I would love to have it test-driven by better coders and puzzlers than I.

Any and all feedback is welcome, from positive to negative, from the sweeping to the picayune. Let me know what confuses or frustrates you -- and especially let me know if (where) you get stuck.

Otherwise, there are no special instructions; it's all in the book.

While _Dimity Jones_ is still in its debugging/proofreading phase, please refrain from sharing it or putting it any (other) public place. (Christine would have been horrified to see her work thus published before it was letter-perfect; but I have exhausted my pool of friends and colleagues both able and willing to tinker with it. This seems like the ideal community of potential testers.)

Thanking you in advance. I hope you enjoy!



I wonder if I've found a small error on the "limitation of Liability" section. There seems to be an extraneous quote mark at the end and I can't find a good place for the limitation of Liability to go since there is no space in "limititation.risk".

I think one issue may be that all the punctuation generally comes after the words but in the case of periods they appear at the beginning of the words and must be moved to the end for the sentence to make sense.

liability of Limitation.risk own my at amusement the enter puzzler"), "the as to referred (hereinafter client the I, .puzzler the me, befall should that mental, or physical injuries, or damages, loss, any for responsibility no assume amusement the of operators and management The .puzzles and blackmail, emotional deception, lights, strobing and/or bright distortions, perceptual challenges, cognitive obstacles, to exposed be may I amusement, the of course the in that acknowledge puzzler, the I, .liability all from amusement the of operators and management the exempt hereby sentence, next the aloud saying by puzzler, the I, .contract verbal this of terms the to agree solemnly and understand hereby "I .time! fun a puzzler, the me, wish amusement the of operators and management the Finally, "


Thanks for the feedback!

The tricky part of this puzzle is how to handle spaces. Prose sentences have regular spacing rules that the ensuing ciphertext doesn't follow. For instance, what to do with several spaces in a row? Should they be rearranged along with the words (effectively be treated AS words), or should they stay put, the words moving around them?

Hint: There are some extra spaces in the waiver that will become indentations if you take the former approach. (It was hoped that the fact that there is no space between the period and "risk" would suggest this: Sentences [following a period] normally start with a space, and end without one; here that is reversed.)

I'm still looking for a better way to hint this, as too many readers are getting hung up on puzzle #2 than I'd like. :)

See also this discussion: https://github.com/larryboyko/dimityjones/discussions/2


Thanks! I will use the github discussion board for future questions.


Happy to see this, I used to love coding adventure books as a kid, where you'd type in a BASIC listing and try to "hack the door" or play a simple video game. I love that this forces the reader to actually solve the problem by using a cipher, looking forward to tackling it!


Thanks! Hope you enjoy it.


What am I doing wrong here? echo "To begin with, for example, and to make sure your SHA-256 hash function is working, the hash value or checksum of this sentence, from capital 'T' to concluding colon, expressed in hexadecimal, is:" | sha256sum

95f5ed58505e08180eaa94f4eb13a0d2003cfe042116fa1767c2189491c36871 which is not

10c0c7d9b0222a5a61601337105f1cbb7b1723b991404b870537095d1174f2b2


Add the -n flag to echo

echo -n "To begin with, for example, and to make sure your SHA-256 hash function is working, the hash value or checksum of this sentence, from capital 'T' to concluding colon, expressed in hexadecimal, is:" | sha256sum

Echo is automatically adding a newline


Editors like vi also add automatically add newlines to the end. You can check with hexdump if you have a newline or not:

    $ echo "To begin with, for example, and to make sure your SHA-256 hash function is working, the hash value or checksum of this sentence, from capital 'T' to concluding colon, expressed in hexadecimal, is:" | hexdump -C
    00000000  54 6f 20 62 65 67 69 6e  20 77 69 74 68 2c 20 66  |To begin with, f|
    00000010  6f 72 20 65 78 61 6d 70  6c 65 2c 20 61 6e 64 20  |or example, and |
    00000020  74 6f 20 6d 61 6b 65 20  73 75 72 65 20 79 6f 75  |to make sure you|
    00000030  72 20 53 48 41 2d 32 35  36 20 68 61 73 68 20 66  |r SHA-256 hash f|
    00000040  75 6e 63 74 69 6f 6e 20  69 73 20 77 6f 72 6b 69  |unction is worki|
    00000050  6e 67 2c 20 74 68 65 20  68 61 73 68 20 76 61 6c  |ng, the hash val|
    00000060  75 65 20 6f 72 20 63 68  65 63 6b 73 75 6d 20 6f  |ue or checksum o|
    00000070  66 20 74 68 69 73 20 73  65 6e 74 65 6e 63 65 2c  |f this sentence,|
    00000080  20 66 72 6f 6d 20 63 61  70 69 74 61 6c 20 27 54  | from capital 'T|
    00000090  27 20 74 6f 20 63 6f 6e  63 6c 75 64 69 6e 67 20  |' to concluding |
    000000a0  63 6f 6c 6f 6e 2c 20 65  78 70 72 65 73 73 65 64  |colon, expressed|
    000000b0  20 69 6e 20 68 65 78 61  64 65 63 69 6d 61 6c 2c  | in hexadecimal,|
    000000c0  20 69 73 3a 0a                                    | is:.|
    000000c5
If the string or file ends in `0a` you have a newline


To add to this, I solved the first puzzle but I'm not getting the right sha256sum for the answer. It's unclear to me which part of the deciphered text I should be doing the checksum on.

The text says: "here are the checksums for all the solutions to the eighty-nine puzzles", is the solution only the newly readable part, or the whole new text that has been transformed?


The whole new text that has been transformed.

A little earlier, the editorial instructions read: "These hash values, or checksums [...], were generated by the SHA-256 algorithm -- implementations of which you should easily be able to find and run on your own plaintexts. (By "plaintext", I mean the entire rest of the file, correctly deciphered -- of which, however, only the next chapter will be legible ... until the subsequent decipherment, and so on.)"

Is that helpful?


You should be (1) deleting everything up to and including "1.#####", then (2) applying the appropriate transformation to what remains. Looking at my code for this step, I see that I removed one newline character at the end of the file before doing everything else, and this apparently yielded the correct result; I didn't do this in subsequent steps.

(I've been playtesting this thing for a while. I'm not all the way through yet.)


>I see that I removed one newline character at the end of the file

Hm, strange. I don't see, and there shouldn't be, an extraneous newline at the end of the (original) file.


Interesting: maybe I added it by mistake in a text editor mishap or something :-).


Hmmm. The original, in fact, does NOT have the 0x0a at the end of the file; however, in process of deleting first part of file up through and including "1.#####", my linux command line tools (or vim?) added one there (unbeknownst to me at the time). I proceeded to solve first puzzle with the 0x0a there at the end in the head-shortened ciphertext, and I got readable plaintext, but my sha256sum does not match yours. If I remove the 0x0a, I get neither readable plaintext nor a matching sha256sum.

(btw, love this project, thanks for sharing it)


This is odd! We can visually troubleshoot this, and see that the first characters following 1.##### are «Cnrtltos » and the final characters at the end of the (original) file are «!niauago». Taking [SPOILER] alternately the first of the first and the last of the last gives us C, o, n, g, r, a, t, u, l, a, t, i, o, n, s, !. If there is an extraneous character inserted at the end, e.g. a newline, the transformation should be spoiled and illegible: C, newline, n, o, r, g, t, a, l, u, t, a, o, i, s, n, space, !.


Dunno if it's helpful for diagnosis, but my 01.txt that yields the expected sha256 sum ...

... is 0x3E1051 bytes long

... starts with <<Congratulations>>, as you already knew it should

... ends with <<IX%7M3+]vW7+zB]{\>>

(It couldn't be line-ending issues, could it? Do you have any 0x0D bytes?)

And, just in case it helps, my original text file (before stripping everything up to 1.#####, and _without_ the spurious 0x0A byte) is 0x3E404D bytes long and ends with << vhuY!niauago>>.


Hm. My 01.txt that yields the expected SHA256 sum of a2e617919bc0b981a4f9bb8470ed37d189958e4c5b167e58b417a84c29a66c29

is:

... 0x3e1175 bytes long

... starts with «Congratulations!»

... ends with «ZO?-m[FmGp-+;KM»


Am I working with an older version of the file or something, perhaps? My copy of the initial file says:

01: 851fa86ed725c26b712ca1218cdec5782259240e403166c5c6c379b22656290b

and that's the sha256sum of my 01.txt .


(I bet I am working with an older version -- I ran across an error in one of the puzzles, and presumably you've fixed that now.)


Ah ha! That's an older version alright.

Latest at https://github.com/larryboyko/dimityjones/blob/main/DimityJo...

(I hope I've fixed the error ...!)


Neat, I'll take a look. You should consider opening the issue or discussion board if you want feedback.


Thanks for the suggestion.

I started a catch-all discussion on the github page.


Who is the target audience for this? Software developers are obviously a good fit, but after spending all day on puzzles, I might not be interested in doing it read a novel, especially one that appears to be about an angsty teenager. (But it is also an interesting idea that makes me curious.) People like my mother, who likes word games and sudoku, also seem like a good audience, but she has no programming background and is probably not excited by the prospect of: choose a suitable programming language + figure out how to install it + editor? + compiling/running + learning the API + who knows what else (from her perspective). However if you could narrow it down to putting together a bunch of primitives (e.g. "swap letters", "swap words", "swap lines", etc.) that would help. This would be similar to text adventure games which give a list of verbs, possibly not exclusive, that you can use. Alternatively, if that gives too much away, having solved it, you could give a list of the functions that are necessary (e.g. if, for, anything in String, anything in Array).

Assuming that the purpose is the puzzle, not programming (unclear, since presumably your wife had to write a program to generate the puzzle text), I would recommend shipping a script with a framework that defines a bunch of solve01, solve02, etc. functions that it calls when you run the script. This framework would load the text, call pass the text to solve01, compute the checksum and if it passes, call solve02 with the result, etc. (And if it fails, stop and report that problem 1 has not been correctly solved yet.) You probably want to provide a much simpler, solved tutorial that introduces loops, arrays, newlines, etc.

This seems like it might be a good way to introduce kids to programming, especially with a framework that holds their hands for things like reading the file for the source text, but which is examinable to see how it works (especially with liberal commenting). You could also provide an inverse, generating framework so that they could write their own puzzles.

I would recommend some usability improvements:

- ship the cyphertext as its own file; this makes it much more reliable for the user to correctly extract the text (because they don't have to). At least give a checksum for the source text.

- non-programmers will need to know that the text must be treated as list of characters, including space, newline, punctuation, etc. (At least, I assume that is required)

- a tutorial program that solves the original boustrophedon-line diary. Personally I think that Python is a better language for a complete beginner than Ruby; it is about as close to running pseudocode as you can get.


As a counterpoint, I really like that the whole puzzle is just a text file. It's simple, and as I mention in another comment, it reminds me of learning to program in my early days.

This may not have any other real purpose than to be a piece of art. Or perhaps it's aimed at a narrow demographic of kids who are already decent programmers. However, it's also entirely possible that others will create a whole ecosystem of "unofficial" tutorials and libraries/frameworks around it.


>This may not have any other real purpose than to be a piece of art.

Christine would've loved this answer.


This is exactly the kind of art I've always enjoyed the most, but I'm most glad that someone finally pointed out to me that it was art. Thank you!


I think it's probably the same audience as something like Advent of Code. People who want to solve programming problems that are more interesting than the typical business logic we have to work on all day.


Beautiful story. Thanks for sharing it here.


Thanks. Hope you enjoy the novel.


> My wife, the author, passed away five years ago.

Condolences for your loss


Thank you.


Sorry to hear about your wife. This looks interesting.

I find this quote a bit funny: > While Dimity Jones is still in its debugging/proofreading phase, please refrain from sharing it more widely or putting it any (other) public place.

If this is picked up here on Hackernews, be ready hehe.


Thank you.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: